Are Python deques linked lists?

Peter Otten __peter__ at web.de
Mon Dec 10 08:33:09 EST 2007


Neil Cerutti wrote:


> [linked lists] don't work well with Python iterators, which aren't
> suitable for a linked list's purposes--so you have to give up the
> happy-joy for loop syntax in favor of Python's frowny-sad while loops.

You can always move the while-loop into a generator and use for-loops
happily ever after.

Peter



More information about the Python-list mailing list