[Python-Dev] Missing operator.call (original) (raw)
Hrvoje Niksic hrvoje.niksic at avl.com
Wed Feb 4 14:35:58 CET 2009
- Previous message: [Python-Dev] Missing operator.call
- Next message: [Python-Dev] Missing operator.call
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Andrew Bennetts wrote:
A patch to add operator.caller(*args, **kwargs) may be a good idea. Your example would then be:
map(operator.caller(), lst)
Regarding the name, note that I proposed operator.call (and operator.call) because it corresponds to the call special method, which is analogous to how operator.neg corresponds to neg, operator.add to add, etc. The term "caller" implies creation of a new object that carries additional state, such as method name in operator.methodcaller, item in operator.itemgetter, or attr in operator.attrgetter.
- Previous message: [Python-Dev] Missing operator.call
- Next message: [Python-Dev] Missing operator.call
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]