[3.6] bpo-28814: Undeprecate inadvertently deprecated inspect functions. (#122) by berkerpeksag · Pull Request #243 · python/cpython (original) (raw)
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation6 Commits1 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Nick Coghlan said on bpo-28814:
inspect.getargvalues() and inspect.formatargvalues() were deprecated
in Python 3.5 as part of implementing bpo-20438
This is incorrect, as these are frame introspection related functions,
not callable introspection ones. The documentation and implementation
layout is confusing though, as they're interleaved with the callable
introspection operation
This commit undeprecates these functions and adds a note to ignore
previous deprecation notices.
(cherry picked from commit 0899b98)
Nick Coghlan said on bpo-28814:
inspect.getargvalues() and inspect.formatargvalues() were deprecated in Python 3.5 as part of implementing bpo-20438
This is incorrect, as these are frame introspection related functions, not callable introspection ones. The documentation and implementation layout is confusing though, as they're interleaved with the callable introspection operation
This commit undeprecates these functions and adds a note to ignore previous deprecation notices.
(cherry picked from commit 0899b98)
I'd like to keep a note that inspect.signature
API is superior and is recommended to use instead of inspect.getargspec
.
Hi @1st1, I agree but can we add it in a separate pull request? This is a backport PR and I'd like to keep this commit as a cherry-pick of 0899b98 :)
Sure. Would you be able to create a new PR for that? Or I can do it.
If you have some spare time this week, that would be great! Otherwise, I will do it next week and ping you to get a review.
I'd like to keep a note that inspect.signature API is superior and is recommended to use instead of inspect.getargspec.
I'm confused, I did not remove such statement and it is already in inspect.rst
:
.. deprecated:: 3.0
Use :func:`getfullargspec` for an updated API that is usually a drop-in
replacement, but also correctly handles function annotations and
keyword-only parameters.
Alternatively, use :func:`signature` and
:ref:`Signature Object <inspect-signature-object>`, which provide a
more structured introspection API for callables.
getargspec also emit a deprecation warning that point to signature()
I can try to do a PR if I better understand what you meant.
jaraco added a commit to jaraco/cpython that referenced this pull request