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

Robert Lehmann report at bugs.python.org
Wed May 30 11:11:01 CEST 2012


Robert Lehmann <lehmannro at gmail.com> added the comment:

Your proposal seems two-fold: (a) make map/filter lazy and (b) have them as methods instead of functions.

It seems Tim borrowed Guido's time machine and already implemented (a) in Python 3.x, see http://docs.python.org/py3k/library/functions.html#map and http://docs.python.org/py3k/library/functions.html#filter.

Your second proposal-- which is better suited for python-ideas, really --is obstructed by iterators being merely a protocol (the next/__next__ method) which makes it hard to add those methods to one particular type. (This very discussion pops up every so often for str.join too.)

I'd recommend closing this issue.

----------
nosy: +lehmannro

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


More information about the Python-bugs-list mailing list