Skip to content

Commit f8f0386

Browse files
miss-islingtonCAM-Gerlach
authored andcommitted
gh-95913: Copyedit & xref FrameInfo in Whatsnew inspect section (GH-98304)
(cherry picked from commit 8f30267) Co-authored-by: C.A.M. Gerlach <[email protected]>
1 parent a1e59b7 commit f8f0386

File tree

2 files changed

+35
-16
lines changed

2 files changed

+35
-16
lines changed

Doc/library/inspect.rst

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,10 @@ attributes:
434434

435435
Return ``True`` if the type of object is a :class:`~types.MethodWrapperType`.
436436

437-
These are instances of :class:`~types.MethodWrapperType`, such as :meth:`~object().__str__`,
438-
:meth:`~object().__eq__` and :meth:`~object().__repr__`
437+
These are instances of :class:`~types.MethodWrapperType`, such as :meth:`~object.__str__`,
438+
:meth:`~object.__eq__` and :meth:`~object.__repr__`.
439+
440+
.. versionadded:: 3.11
439441

440442

441443
.. function:: isroutine(object)
@@ -1206,12 +1208,13 @@ is considered deprecated and may be removed in the future.
12061208
number, start column offset, and end column offset associated with the
12071209
instruction being executed by the frame this record corresponds to.
12081210

1209-
.. versionchanged:: 3.5
1210-
Return a named tuple instead of a tuple.
1211+
.. versionchanged:: 3.5
1212+
Return a :term:`named tuple` instead of a :class:`tuple`.
1213+
1214+
.. versionchanged:: 3.11
1215+
:class:`!FrameInfo` is now a class instance
1216+
(that is backwards compatible with the previous :term:`named tuple`).
12111217

1212-
.. versionchanged:: 3.11
1213-
Changed the return object from a named tuple to a regular object (that is
1214-
backwards compatible with the previous named tuple).
12151218

12161219
.. class:: Traceback
12171220

@@ -1245,6 +1248,11 @@ is considered deprecated and may be removed in the future.
12451248
the instruction being executed by the frame this traceback corresponds
12461249
to.
12471250

1251+
.. versionchanged:: 3.11
1252+
:class:`!Traceback` is now a class instance
1253+
(that is backwards compatible with the previous :term:`named tuple`).
1254+
1255+
12481256
.. note::
12491257

12501258
Keeping references to frame objects, as found in the first element of the frame

Doc/whatsnew/3.11.rst

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -746,22 +746,33 @@ IDLE and idlelib
746746
* Include prompts when saving Shell with inputs and outputs.
747747
(Contributed by Terry Jan Reedy in :gh:`95191`.)
748748

749+
750+
.. _whatsnew311-inspect:
751+
749752
inspect
750753
-------
751-
* Add :func:`inspect.getmembers_static`: return all members without
754+
755+
* Add :func:`~inspect.getmembers_static` to return all members without
752756
triggering dynamic lookup via the descriptor protocol. (Contributed by
753757
Weipeng Hong in :issue:`30533`.)
754758

755-
* Add :func:`inspect.ismethodwrapper` for checking if the type of an object is a
756-
:class:`~types.MethodWrapperType`. (Contributed by Hakan Çelik in :issue:`29418`.)
759+
* Add :func:`~inspect.ismethodwrapper`
760+
for checking if the type of an object is a :class:`~types.MethodWrapperType`.
761+
(Contributed by Hakan Çelik in :issue:`29418`.)
757762

758-
* Change the frame-related functions in the :mod:`inspect` module to return a
759-
regular object (that is backwards compatible with the old tuple-like
760-
interface) that include the extended :pep:`657` position information (end
763+
* Change the frame-related functions in the :mod:`inspect` module to return new
764+
:class:`~inspect.FrameInfo` and :class:`~inspect.Traceback` class instances
765+
(backwards compatible with the previous :term:`named tuple`-like interfaces)
766+
that includes the extended :pep:`657` position information (end
761767
line number, column and end column). The affected functions are:
762-
:func:`inspect.getframeinfo`, :func:`inspect.getouterframes`, :func:`inspect.getinnerframes`,
763-
:func:`inspect.stack` and :func:`inspect.trace`. (Contributed by Pablo Galindo in
764-
:gh:`88116`.)
768+
769+
* :func:`inspect.getframeinfo`
770+
* :func:`inspect.getouterframes`
771+
* :func:`inspect.getinnerframes`,
772+
* :func:`inspect.stack`
773+
* :func:`inspect.trace`
774+
775+
(Contributed by Pablo Galindo in :gh:`88116`.)
765776

766777
locale
767778
------

0 commit comments

Comments
 (0)