[issue1748064] inspect.getargspec fails on built-in or slot wrapper methods

Nick Coghlan report at bugs.python.org
Mon May 16 14:05:41 CEST 2011


Nick Coghlan <ncoghlan at gmail.com> added the comment:

The challenge with C functions is that this becomes *additional* metadata that somehow needs to be provided to the method and function creation process. None of our APIs are set up to accept that information (and obviously no code is set up to provide it, either).

What might be nice is a way to graft the signature information from a Python implementation onto a C implementation (which would be quite straightforward given PEP 362 and a writable __signature__ slot in the C objects).

The other virtue of this approach is that the Python metadata will be testable, so it doesn't run the same risk of getting out of date that manually maintained metadata at the C level does. It would work naturally for C acceleration modules, and wouldn't be any more effort to add for pure C code than direct annotations at the C level would be.

----------
nosy: +ncoghlan

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


More information about the Python-bugs-list mailing list