Speed revisited

Nick Coghlan ncoghlan at iinet.net.au
Mon Jan 10 08:33:08 EST 2005


John Machin wrote:
> My wild guess: Not a common use case. Double-ended queue is a special
> purpose structure.

As Kent said, the suggestion of making index 0 insertions and deletions on lists 
more efficent was made, and the decision was to leave list alone and provide 
collections.deque instead. This let deque sacrifice some of list's flexibility 
in favour of increased speed.

Appropriate parts of the core which needed a FIFO were then updated to use the 
new data type, while everything else continues to use lists.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at email.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.skystorm.net



More information about the Python-list mailing list