Feature Requests item #912738, was opened at 2004-03-09 09:13
Message generated for change (Comment added) made by tim_one
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=912738&group_id=5470
Category: Python Interpreter Core
Group: None
Status: Closed
Resolution: Rejected
Priority: 5
Submitted By: Ragnar Kj?rstad (ragnark)
Assigned to: Nobody/Anonymous (nobody)
Summary: Generator-support in map() and filter()
Initial Comment:
The current implementation of map() and filter()
returns a list when executed on any iterator, including
generators.
However, it may be very useful to map and filter the
output from generators without having to generate all
the data and allocate memory for it.
I would propose for map() and filter() to return a
generator-object instead of a list when the
input-argument is a generator.
----------------------------------------------------------------------
Comment By: Tim Peters (tim_one)
Date: 2004-03-09 15:11
Message:
Logged In: YES
user_id=31435
It's (far) too late to change the signature of map() and filter
(). Look in the itertools module instead: its ifilter() and imap
() functions already do what you asked for (and more).
----------------------------------------------------------------------