Skip to content

Commit 0246422

Browse files
berkerpeksagncoghlan
authored andcommitted
bpo-28814: Undeprecate inadvertently deprecated inspect functions. (#122) (#244)
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)
1 parent 5010a77 commit 0246422

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

Doc/library/inspect.rst

+4-8
Original file line numberDiff line numberDiff line change
@@ -875,10 +875,8 @@ Classes and functions
875875
are the names of the ``*`` and ``**`` arguments or ``None``. *locals* is the
876876
locals dictionary of the given frame.
877877

878-
.. deprecated:: 3.5
879-
Use :func:`signature` and
880-
:ref:`Signature Object <inspect-signature-object>`, which provide a
881-
better introspecting API for callables.
878+
.. note::
879+
This function was inadvertently marked as deprecated in Python 3.5.
882880

883881

884882
.. function:: formatargspec(args[, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations[, formatarg, formatvarargs, formatvarkw, formatvalue, formatreturns, formatannotations]])
@@ -914,10 +912,8 @@ Classes and functions
914912
:func:`getargvalues`. The format\* arguments are the corresponding optional
915913
formatting functions that are called to turn names and values into strings.
916914

917-
.. deprecated:: 3.5
918-
Use :func:`signature` and
919-
:ref:`Signature Object <inspect-signature-object>`, which provide a
920-
better introspecting API for callables.
915+
.. note::
916+
This function was inadvertently marked as deprecated in Python 3.5.
921917

922918

923919
.. function:: getmro(cls)

Doc/whatsnew/3.5.rst

+6-5
Original file line numberDiff line numberDiff line change
@@ -2327,11 +2327,12 @@ The :func:`inspect.getargspec` function is deprecated and scheduled to be
23272327
removed in Python 3.6. (See :issue:`20438` for details.)
23282328

23292329
The :mod:`inspect` :func:`~inspect.getfullargspec`,
2330-
:func:`~inspect.getargvalues`, :func:`~inspect.getcallargs`,
2331-
:func:`~inspect.getargvalues`, :func:`~inspect.formatargspec`, and
2332-
:func:`~inspect.formatargvalues` functions are deprecated in favor of
2333-
the :func:`inspect.signature` API.
2334-
(Contributed by Yury Selivanov in :issue:`20438`.)
2330+
:func:`~inspect.getcallargs`, and :func:`~inspect.formatargspec` functions are
2331+
deprecated in favor of the :func:`inspect.signature` API. (Contributed by Yury
2332+
Selivanov in :issue:`20438`.)
2333+
2334+
:func:`~inspect.getargvalues` and :func:`~inspect.formatargvalues` functions
2335+
were inadvertently marked as deprecated with the release of Python 3.5.0.
23352336

23362337
Use of :const:`re.LOCALE` flag with str patterns or :const:`re.ASCII` is now
23372338
deprecated. (Contributed by Serhiy Storchaka in :issue:`22407`.)

0 commit comments

Comments
 (0)