Python deque extendleft with a tuple?
<p>I have a <code>deque</code> with max length of 10.  Is is possible to <code>.extendleft</code> and add a tuple.  For example:</p>

<pre><code>from collections import deque

x = deque(maxlen = 10)
z = [(1,4),(1,3),(2,5),(7,1),(6,4),(8,2),(9,1),(9,5),(7,3),(8,3)] 
for y in z:
    x.append(y)
print x
x.extendleft((6,7))
print x
</code></pre>

<p>Returns:</p>

<pre><code>deque([(1, 4), (1, 3), (2, 5), (7, 1), (6, 4), (8, 2), (9, 1), (9, 5), (7, 3), (8, 3)], maxlen=10)
deque([7, 6, (1, 4), (1, 3), (2, 5), (7, 1), (6, 4), (8, 2), (9, 1), (9, 5)], maxlen=10)
</code></pre>

<p>I tried:
    pair = (6,7)
    x.extendleft(pair)
with the same results.</p>
