[ python-Feature Requests-1506171 ] Add "methodcaller" to the operator module
SourceForge.net
noreply at sourceforge.net
Fri Mar 30 16:39:22 CEST 2007
Feature Requests item #1506171, was opened at 2006-06-14 12:02
Message generated for change (Comment added) made by collinwinter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1506171&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: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Private: No
Submitted By: Gregory Petrosyan (gregory_p)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add "methodcaller" to the operator module
Initial Comment:
I found that I (like Alex Martelli, http://mail.python.
org/pipermail/python-dev/2006-February/060341.html :-)
am writing lambdas like "lambda x: x.do_smth(a,b,c)" a
lot (often for filter/map functions). So, I think it
would be great to have such a function implemented in
C and placed in the standart library. Operator module
can be a good place for it.
--
Regards, Gregory.
----------------------------------------------------------------------
>Comment By: Collin Winter (collinwinter)
Date: 2007-03-30 10:39
Message:
Logged In: YES
user_id=1344176
Originator: NO
Guido has stated that lambda will not be removed in Python 3000 (see PEP
3099), so I can't see the need for a HOF to avoid lambda-usage, especially
when the lambda expression is shorter/clearer:
operator.methodcaller('method', x, y, z)
lambda x: x.method(x, y, z)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1506171&group_id=5470
More information about the Python-bugs-list
mailing list