Skip to content

Commit 519b56a

Browse files
gh-95913: Copyedit & xref FrameInfo in Whatsnew inspect section (GH-98304)
(cherry picked from commit 8f30267) Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
1 parent 24e8d0c commit 519b56a

File tree

2 files changed

+35
-16
lines changed

2 files changed

+35
-16
lines changed

Doc/library/inspect.rst

+15-7
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

+20-9
Original file line numberDiff line numberDiff line change
@@ -775,22 +775,33 @@ IDLE and idlelib
775775
* Include prompts when saving Shell with inputs and outputs.
776776
(Contributed by Terry Jan Reedy in :gh:`95191`.)
777777

778+
779+
.. _whatsnew311-inspect:
780+
778781
inspect
779782
-------
780-
* Add :func:`inspect.getmembers_static`: return all members without
783+
784+
* Add :func:`~inspect.getmembers_static` to return all members without
781785
triggering dynamic lookup via the descriptor protocol. (Contributed by
782786
Weipeng Hong in :issue:`30533`.)
783787

784-
* Add :func:`inspect.ismethodwrapper` for checking if the type of an object is a
785-
:class:`~types.MethodWrapperType`. (Contributed by Hakan Çelik in :issue:`29418`.)
788+
* Add :func:`~inspect.ismethodwrapper`
789+
for checking if the type of an object is a :class:`~types.MethodWrapperType`.
790+
(Contributed by Hakan Çelik in :issue:`29418`.)
786791

787-
* Change the frame-related functions in the :mod:`inspect` module to return a
788-
regular object (that is backwards compatible with the old tuple-like
789-
interface) that include the extended :pep:`657` position information (end
792+
* Change the frame-related functions in the :mod:`inspect` module to return new
793+
:class:`~inspect.FrameInfo` and :class:`~inspect.Traceback` class instances
794+
(backwards compatible with the previous :term:`named tuple`-like interfaces)
795+
that includes the extended :pep:`657` position information (end
790796
line number, column and end column). The affected functions are:
791-
:func:`inspect.getframeinfo`, :func:`inspect.getouterframes`, :func:`inspect.getinnerframes`,
792-
:func:`inspect.stack` and :func:`inspect.trace`. (Contributed by Pablo Galindo in
793-
:gh:`88116`.)
797+
798+
* :func:`inspect.getframeinfo`
799+
* :func:`inspect.getouterframes`
800+
* :func:`inspect.getinnerframes`,
801+
* :func:`inspect.stack`
802+
* :func:`inspect.trace`
803+
804+
(Contributed by Pablo Galindo in :gh:`88116`.)
794805

795806
locale
796807
------

0 commit comments

Comments
 (0)