Sorted Returns List and Reversed Returns Iterator
Fredrik Lundh
fredrik at pythonware.com
Fri Aug 22 03:14:11 EDT 2008
More information about the Python-list mailing list
Fri Aug 22 03:14:11 EDT 2008
- Previous message (by thread): Sorted Returns List and Reversed Returns Iterator
- Next message (by thread): def X(l=[]): weirdness. Python bug ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
John Machin wrote: > reversed came later; returning an iterator rather than a list provides > more flexibility. As in flexibility for the implementer, the day someone invents a sort algorithm that doesn't have to look at all source items before it starts producing output? Because I fail to see how returning an object that supports forward iteration only is more flexible for the *user* than returning an object that supports random access, mutation, restartable iteration, *and* forward iteration. </F>
- Previous message (by thread): Sorted Returns List and Reversed Returns Iterator
- Next message (by thread): def X(l=[]): weirdness. Python bug ?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list