It appears that collections.deque is a doubly-linked-list library in Python. According to the documentation, it should have approximately O(1) cost when appending or popping from the head or the tail, as well as O(n) for regular inserts (which matches what we'd expect from a linked list).
API: http://docs.python.org/2/library/collections.html#collections.deque
Source: https://stackoverflow.com/a/282238/2441252