[issue14961] map() and filter() methods for iterators

Nick Coghlan report at bugs.python.org
Wed May 30 13:01:16 CEST 2012


Nick Coghlan <ncoghlan at gmail.com> added the comment:

As Robert noted, the map() and filter() builtins in Python 3 are already lazy and there's no reason to expand the iterator protocol for this functionality.

Map and filter also have dedicated syntax in the form of comprehensions and generator expressions:

    itr = (x for x in map(abs, range(10)) if x % 5 == 0)

Furthermore, the standard library already provides an entire module of tools for creating and working with lazy iterators in both Python 2 and Python 3: http://docs.python.org/library/itertools

----------
nosy: +ncoghlan
resolution:  -> rejected
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14961>
_______________________________________


More information about the Python-bugs-list mailing list