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 <rep...@bugs.python.org>
<http://bugs.python.org/issue25770>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to