title: Python Set Slice Complexity
body: <p>Assume that I have two lists named a and b of both size n, and I want to do the following slice setting operation with k &lt; n</p>
  
  <pre><code>a[:k] = b[:k]
  </code></pre>
  
  <p>In the Python wiki's <a href="https://wiki.python.org/moin/TimeComplexity" rel="noreferrer">Time Complexity</a> page it says that the complexity of slice setting is O(n+k) where k is the length of the slice. I just cannot understand why it is not just O(k) in the above situation.</p>
  
  <p>I know that slicing returns a new list, so it is O(k), and I know that the list holds its data in a continuous way, so inserting an item in the middle would take O(n) time. But the above operation can easily be done in O(k) time. Am I missing something?</p>
  
  <p>Furthermore, is there a documentation where I can find detailed information about such issues? Should I look into the CPython implementation?</p>
  
  <p>Thanks.</p>