New submission from Evgeny Kapun:
Currently, operator.methodcaller behaves like this:
def methodcaller(name, *args, **kwargs):
def caller(obj):
return getattr(obj, name)(*args, **kwargs)
return caller
That is, it is possible to supply arguments when the object is created but not
during the call. I think that it will be more useful if it behaved like this:
def methodcaller(name, *args, **kwargs):
def caller(obj, *args2, **kwargs2):
return getattr(obj, name)(*args, *args2, **kwargs, **kwargs2)
return caller
----------
components: Extension Modules
messages: 253307
nosy: abacabadabacaba
priority: normal
severity: normal
status: open
title: operator.methodcaller should accept additional arguments during the call
type: enhancement
versions: Python 3.5, Python 3.6
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue25454>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com