[issue27172] Undeprecate inspect.getfullargspec()

Nick Coghlan report at bugs.python.org
Thu Nov 30 07:41:27 EST 2017


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

If there was a documented deprecation that said "Use <this PyPI package> instead", I'd be OK with that.

The part I wasn't OK with is multiple projects each copying & pasting their own variant of the getfullargspec code and accessing private inspect module APIs in order to get the old behaviour back.

So in order to move this to PyPI instead, we'd need to offer a completely public API that was equivalent to `_signature_from_callable(func, follow_wrapper_chains=False, skip_bound_arg=False, sigcls=Signature)`

`inspect.Signature.from_callable(func, follow_wrapped=False)` comes very close, but misses a subtlety where "getfullargspec" will mention "self" for bound methods, even though it's implicitly supplied, and doesn't need to be supplied by the caller.

That aspect could potentially just be deprecated outright though, with the PyPI replacement following inspect.signature's behaviour and reporting the actual call signature of the bound method.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27172>
_______________________________________


More information about the Python-bugs-list mailing list