[Python-Dev] PEP czar for PEP 3144?
Guido van Rossum
guido at python.org
Tue Mar 20 00:34:17 CET 2012
More information about the Python-Dev mailing list
Tue Mar 20 00:34:17 CET 2012
- Previous message: [Python-Dev] PEP czar for PEP 3144?
- Next message: [Python-Dev] PEP czar for PEP 3144?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, Mar 19, 2012 at 3:44 PM, Terry Reedy <tjreedy at udel.edu> wrote: > I am not sure which way you are pointing, but the general default in 3.x is > to return iterators: range, zip, enumerate, map, filter, reversed, open > (file objects), as well at the dict methods. Actually as I tried to say, the dict methods (keys() etc.) DON'T return iterators. They return "views" which are iterable. Anyway, I also tried to imply that it matters if the number of list items would ever be huge. It seems that is indeed possible (even if not likely) so I think iterators are useful. > I am quite happy to be rid of > the 'iter' prefix on the latter. This is aside from itertools. The main > exceptions I can think of are str.split and sorted. For sorted, a list > *must* be constructed anyway, so might as well return it. This apparently > matches the case under consideration. If name differentiation is wanted, > call it xxxlist. Agreed, ideally you don't need to know or it'll be obvious from the name without an explicit 'list' or 'iter'. -- --Guido van Rossum (python.org/~guido)
- Previous message: [Python-Dev] PEP czar for PEP 3144?
- Next message: [Python-Dev] PEP czar for PEP 3144?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list