[New-bugs-announce] [issue25770] expose name, args, and kwargs from methodcaller

Joe Jevnik report at bugs.python.org
Mon Nov 30 21:07:11 EST 2015


New submission from Joe Jevnik:

This patch adds 3 properties to methodcaller objects for inspecting the object at runtime:

1. 'name': the name of the method to call
2. 'args': the position arguments to pass to the method
3. 'keywords': the keyword arguments to pass to the method

args and keywords act like functools.partial (that is why I did not name it kwargs).

I noticed that recently the repr changed to expose this information which helps in the debugging use case; however, this allows us to use the methodcaller to maybe construct a new methodcaller with different args, or call a different method with the same args.

----------
components: Library (Lib)
files: methodcaller-attrs.patch
keywords: patch
messages: 255636
nosy: llllllllll
priority: normal
severity: normal
status: open
title: expose name, args, and kwargs from methodcaller
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file41198/methodcaller-attrs.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25770>
_______________________________________


More information about the New-bugs-announce mailing list