[ python-Feature Requests-1506122 ] Add "compose" function to the functools

SourceForge.net noreply at sourceforge.net
Mon Mar 19 20:07:31 CET 2007


Feature Requests item #1506122, was opened at 2006-06-14 11:12
Message generated for change (Comment added) made by collinwinter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1506122&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: Python Library
>Group: Python 2.6
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Gregory Petrosyan (gregory_p)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add "compose" function to the functools

Initial Comment:
I think it would be very usefull to have something 
similar to Haskell's "dot" operator in Python, IMO it 
should be something like this (untested):

def compose(f, g):
    return lambda *args, **kws: f(g(*args, **kws))

but C-coded. So, _functools can be a good place for it.

--
Regards, Gregory.


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

>Comment By: Collin Winter (collinwinter)
Date: 2007-03-19 15:07

Message:
Logged In: YES 
user_id=1344176
Originator: NO

If there's interest in this, I already have an implementation in my
functional package (http://cheeseshop.python.org/pypi/functional).

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

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


More information about the Python-bugs-list mailing list