Skip to content

Commit 7dacbbf

Browse files
committed
3.11 Whatsnew: Combine error locations sections to avoid duplication
1 parent d0e8c28 commit 7dacbbf

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

Doc/c-api/code.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.. highlight:: c
22

3-
.. _codeobjects:
4-
53
.. index:: object; code, code object
64

5+
.. _codeobjects:
6+
77
Code Objects
88
------------
99

Doc/whatsnew/3.11.rst

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ As well as complex arithmetic expressions:
149149
~~~~~~^~~
150150
ZeroDivisionError: division by zero
151151
152+
Additionally, the information used by the enhanced traceback feature
153+
is made available via a general API, that can be used to correlate
154+
:term:`bytecode` :ref:`instructions <bytecodes>` with source code location.
155+
This information can be retrieved using:
156+
157+
- The :meth:`codeobject.co_positions` method in Python.
158+
- The :c:func:`PyCode_Addr2Location` function in the C API.
159+
152160
See :pep:`657` for more details. (Contributed by Pablo Galindo, Batuhan Taskaya
153161
and Ammar Askar in :issue:`43950`.)
154162

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

164172

165-
Column information for code objects
166-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
167-
168-
The information used by the enhanced traceback feature is made available as a
169-
general API that can be used to correlate bytecode instructions with source
170-
code. This information can be retrieved using:
171-
172-
- The :meth:`codeobject.co_positions` method in Python.
173-
- The :c:func:`PyCode_Addr2Location` function in the C-API.
174-
175-
The :option:`-X` ``no_debug_ranges`` option and the environment variable
176-
:envvar:`PYTHONNODEBUGRANGES` can be used to disable this feature.
177-
178-
See :pep:`657` for more details. (Contributed by Pablo Galindo, Batuhan Taskaya
179-
and Ammar Askar in :issue:`43950`.)
180-
181-
182173
PEP 654: Exception Groups and ``except*``
183174
-----------------------------------------
184175

0 commit comments

Comments
 (0)