title: How to slice a deque?
body: <p>I've changed some code that used a list to using a deque.  I can no longer slice into it, as I get the error:</p>
  
  <blockquote>
    <p>TypeError: sequence index must be integer, not 'slice'</p>
  </blockquote>
  
  <p>Here's a REPL that shows the problem.</p>
  
  <pre><code>&gt;&gt;&gt; import collections
  &gt;&gt;&gt; d = collections.deque()
  &gt;&gt;&gt; for i in range(3):
  ...     d.append(i)
  ...
  &gt;&gt;&gt; d
  deque([0, 1, 2])
  &gt;&gt;&gt; d[2:]
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: sequence index must be integer, not 'slice'
  </code></pre>
  
  <p>So, is there a workaround to support slicing into deques in Python?</p>