examples/lists/queue.py
from __future__ import print_function
from collections import deque

items = deque(['foo', 'bar'])
print(type(items))  # <type 'collections.deque'>
print(items)        # deque(['foo', 'bar'])
items.append('zorg')
print(items)        # deque(['foo', 'bar', 'zorg'])

items.append('zorg')
print(items)        # deque(['foo', 'bar', 'zorg', 'zorg'])
n = items.popleft()
print(n)            # 'foo'
print(items)        # deque(['bar', 'zorg', 'zorg'])