Reversing an iterator with older version of Python

Aki Niimura akineko at pacbell.net
Thu Nov 13 12:28:09 EST 2003


"A.M. Kuchling" <amk at amk.ca> wrote in message 
> Convert it to a list and then reverse the list:
> 
>     L = list(iterator)
>     L.reverse()

It did the job for me.
Now my python program is working as I intended.
Hope I can move to a newer version of Python soon so that I can use
an iterator much like a list.

Thank you!
Aki Niimura




More information about the Python-list mailing list