On Jan 25, 2010, at 12:36 PM, Steve Howell wrote:
>
> Deque does not support all the operations that list does. It is also roughly
> twice as slow for accessing elements (I've measured it).
ISTM that apps that want to insert or pop from the front of list are also apps
that don't care about accessing arbitrary elements in the middle using the
position index. When lists are growing or shrinking from the front, the
meaning of the i-th element changes. So, it doesn't make sense for an
application to track indices of objects in such a list.
i = s.find('abc')
s.pop(0)
print s[i] # i no longer points at 'abc'
Raymond
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com