[issue36751] Changes in the inspect module for PEP 570

Brett Cannon report at bugs.python.org
Tue May 14 00:14:58 EDT 2019


Brett Cannon <brett at python.org> added the comment:

RE: "if a function continues to work correctly throughout the span of a Python X version, why does it need to be removed?"

In this case the argument is whether inspect.getfullargspec() works correctly in the face of positional-only parameters. There's also the usual maintenance burden like any other open source project has.

I know for me the thing is that getfullargspec() keeps getting patched up to support any changes we make to function signatures that aren't the smoothest or more accurate way to represent new semantics and so it hasn't been maintenance-free. And in the face of inspect.Signature which feels like a cleaner solution that is easier to improve upon as function signatures change it makes folks not want to keep putting work into the older functions.

I personally think we should at least document the deprecation of the functions to strongly encourage people to not use it in new code. I don't find the "Note that signature() and Signature Object provide the recommended API for callable introspection" message "loud" enough to get the message across.

----------

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


More information about the Python-bugs-list mailing list