[Python-3000] map() Returns Iterator

Kurt B. Kaiser kbk at shore.net
Tue Aug 7 07:09:15 CEST 2007


"Raymond Hettinger" <python at rcn.com> writes:

> Not really.  Once range() starts returning an iterator,
> that will be the new, basic norm.  With that as a foundation,
> it would be suprising if map() and enumerate() and zip()
> did not return iterators.  Learn once, use everywhere.

Except that range() is usually used in a loop, while map() and filter()
are not.  It seems to me that these two functions are going to expose
naked iterators to beginners (well, intermediates) more than the other
changes will.

-- 
KBK


More information about the Python-3000 mailing list