2 messages in org.python.python-bugs-list[ python-Feature Requests-912738 ] Ge...
FromSent OnAttachments
SourceForge.netMar 9, 2004 3:02 pm 
SourceForge.netMar 9, 2004 3:11 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[ python-Feature Requests-912738 ] Generator-support in map() and filter()Actions...
From:SourceForge.net (nore@sourceforge.net)
Date:Mar 9, 2004 3:11:37 pm
List:org.python.python-bugs-list

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).

----------------------------------------------------------------------