[Patches] [ python-Patches-774414 ] Add a stream type and a merge type to itertoolsmodule.c

SourceForge.net noreply@sourceforge.net
Sat, 19 Jul 2003 17:53:22 -0700


Patches item #774414, was opened at 2003-07-19 19:53
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=774414&group_id=5470

Category: Modules
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Ben Wolfson (rumjuggler)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add a stream type and a merge type to itertoolsmodule.c

Initial Comment:
This patch adds a stream type to itertoolsmodule.c,
which provides a way to cache results from a generator.
 This is useful if you want to iterate over the
generator more than once.  It also lets potentially
infinite generators simulate lists/tuples;
stream(some_generator())[10] produces the first 11
values from the generator and returns the last one, but
doesn't produce any more.

The other type added is useable to merge the output of
two (sorted) iterables into one iterable.

I assume documentation would also need to be updated if
this patch gets accepted, but since I imagine that
won't be an open-and-shut case I haven't written any yet.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=774414&group_id=5470