title: Can I create a "view" on a Python list?
body: <p>I have a large list <code>l</code>. I want to create a view from element 4 to 6. I can do it with sequence slice.</p>
  <pre><code>&gt;&gt;&gt; l = range(10)
  &gt;&gt;&gt; lv = l[3:6]
  &gt;&gt;&gt; lv
  [3, 4, 5]
  </code></pre>
  <p>However <code>lv</code> is a copy of a slice of <code>l</code>. If I change the underlying list, <code>lv</code> does not reflect the change.</p>
  <pre><code>&gt;&gt;&gt; l[4] = -1
  &gt;&gt;&gt; lv
  [3, 4, 5]
  </code></pre>
  <p>Vice versa I want modification on <code>lv</code> reflect in <code>l</code> as well. Other than that the list size are not going to be changed.</p>
  <p>I'm not looking forward to build a big class to do this. I'm just hoping other Python gurus may know some hidden language trick. Ideally I hope it can be like pointer arithmetic in C:</p>
  <pre class="lang-c prettyprint-override"><code>int lv[] = l + 3;
  </code></pre>