Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[3.6] bpo-28814: Undeprecate inadvertently deprecated inspect functions. (#122) #243

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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2017

Conversation

berkerpeksag
Copy link
Member

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)

…ython#122)

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)
@1st1
Copy link
Member

1st1 commented Feb 22, 2017

I'd like to keep a note that inspect.signature API is superior and is recommended to use instead of inspect.getargspec.

@berkerpeksag
Copy link
Member Author

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 :)

@1st1
Copy link
Member

1st1 commented Feb 22, 2017

Sure. Would you be able to create a new PR for that? Or I can do it.

@berkerpeksag
Copy link
Member Author

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.

@Carreau
Copy link
Contributor

Carreau commented Feb 23, 2017

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.

@ncoghlan ncoghlan merged commit 2197eac into python:3.6 Feb 23, 2017
@ncoghlan
Copy link
Contributor

@1st1 As @Carreau notes, these PRs aren't about the function introspection APIs (which are covered by http://bugs.python.org/issue27172 ). Rather, they're about http://bugs.python.org/issue28814, which covers a couple of frame introspection APIs that were inadvertently caught up in those deprecations because they're mixed in with the function introspection ones.

@berkerpeksag berkerpeksag deleted the 122-backport-3.6 branch February 23, 2017 23:02
jaraco added a commit to jaraco/cpython that referenced this pull request Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants