Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
3.11 Whatsnew: Combine error locations sections to avoid duplication
  • Loading branch information
CAM-Gerlach committed Aug 14, 2022
commit 7dacbbfea7a699eb243e5cbde96878f55f795704
4 changes: 2 additions & 2 deletions Doc/c-api/code.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.. highlight:: c

.. _codeobjects:

.. index:: object; code, code object

.. _codeobjects:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this change affect :ref: and index entries linking (if it does)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't affect the index entries (it still links to the same place, right above the section) but fixes an issue with the ref target not actually being the section as intended, and thus not having a generated link text causing :ref:`codeobjects` to error out. It won't affect any existing refs, since it only changes the generated link text and not the ref target location, which the existing refs could not be using or they would have errored and failed the build.

Code Objects
------------

Expand Down
25 changes: 8 additions & 17 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ As well as complex arithmetic expressions:
~~~~~~^~~
ZeroDivisionError: division by zero

Additionally, the information used by the enhanced traceback feature
is made available via a general API, that can be used to correlate
:term:`bytecode` :ref:`instructions <bytecodes>` with source code location.
This information can be retrieved using:

- The :meth:`codeobject.co_positions` method in Python.
- The :c:func:`PyCode_Addr2Location` function in the C API.

See :pep:`657` for more details. (Contributed by Pablo Galindo, Batuhan Taskaya
and Ammar Askar in :issue:`43950`.)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and Ammar Askar in :issue:`43950`.)
and Ammar Askar in :gh:`88116`.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above


Expand All @@ -162,23 +170,6 @@ and Ammar Askar in :issue:`43950`.)
or the :envvar:`PYTHONNODEBUGRANGES` environment variable.


Column information for code objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The information used by the enhanced traceback feature is made available as a
general API that can be used to correlate bytecode instructions with source
code. This information can be retrieved using:

- The :meth:`codeobject.co_positions` method in Python.
- The :c:func:`PyCode_Addr2Location` function in the C-API.

The :option:`-X` ``no_debug_ranges`` option and the environment variable
:envvar:`PYTHONNODEBUGRANGES` can be used to disable this feature.

See :pep:`657` for more details. (Contributed by Pablo Galindo, Batuhan Taskaya
and Ammar Askar in :issue:`43950`.)


PEP 654: Exception Groups and ``except*``
-----------------------------------------

Expand Down