[Patches] [ python-Patches-1412451 ] Fill out the functional module

SourceForge.net noreply at sourceforge.net
Mon Jan 23 03:21:20 CET 2006


Patches item #1412451, was opened at 2006-01-22 21:21
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=1412451&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Modules
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Collin Winter (collinwinter)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fill out the functional module

Initial Comment:
This patch is an expansion of my earlier patch,
#1410119, and should be considered to supersede it.

This patch fixes a reference leak in the earlier
implementation of foldr. The reference leak was tricky
to trigger, but existed.

In addition, this patch breaks the functional module
into two parts: Modules/_functionalmodule.c and
Lib/functional.py. The latter is for list-producing
functions which are better implemented as generators
(to make them lazier), while the former is reserved for
non-list-producing functions, written in C for speed.
Lib/functional.py imports the `_functional` module
generated from Modules/_functionalmodule.c.

The total contents of the functional module:
+ compose
+ concat
+ concatMap
+ cycle
+ drop
+ dropWhile
+ flip
+ foldl
+ foldl1
+ foldr
+ foldr1
+ id
+ iterate
+ partial
+ repeat
+ scanl
+ scanl1
+ scanr
+ scanr1
+ take
+ takeWhile

In addition to a full test-suite and latex-formatted
documentation for all functions, this patch also adds a
functional/ directory to Demo/ and populates it with
examples.

After applying this patch, the existing
Modules/functionalmodule.c should be removed and
replaced with the attached _functionalmodule.c (sorry,
I couldn't figure out how to make this show up in an
svn diff reliably).

The patch is against svn revision 42148.

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

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


More information about the Patches mailing list