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.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com