A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-February/085867.html below:

[Python-Dev] Missing operator.call

[Python-Dev] Missing operator.call [Python-Dev] Missing operator.callHrvoje Niksic hrvoje.niksic at avl.com
Wed Feb 4 14:02:17 CET 2009
Is there a reason why the operator module doesn't have an operator.call 
function?  It would seem logical to be able to write:

map(operator.call, lst)

which calls each object in lst, just like map(operator.neg, lst) negates 
every object.  Of course, operator.call is equivalent to lambda x: x(), 
but such an equivalence exists for all functions in the operator module.

__call__ should also be provided for symmetry with other operators that 
correspond to special-name methods.

If there is interest in this and no reason why it shouldn't be done, I 
can write up an issue in the tracker and provide a patch.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4