Skip to content

Commit 3dfe32b

Browse files
committed
3.11 Whatsnew: Revise desc of enhanced error locations feature
1 parent 7da4937 commit 3dfe32b

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

Doc/whatsnew/3.11.rst

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Enhanced error locations in tracebacks
8888
--------------------------------------
8989

9090
When printing tracebacks, the interpreter will now point to the exact expression
91-
that caused the error instead of just the line. For example:
91+
that caused the error, instead of just the line. For example:
9292

9393
.. code-block:: python
9494
@@ -101,9 +101,9 @@ that caused the error instead of just the line. For example:
101101
^^^^^^^^^
102102
AttributeError: 'NoneType' object has no attribute 'x'
103103
104-
Previous versions of the interpreter would point to just the line making it
104+
Previous versions of the interpreter would point to just the line, making it
105105
ambiguous which object was ``None``. These enhanced errors can also be helpful
106-
when dealing with deeply nested dictionary objects and multiple function calls,
106+
when dealing with deeply nested :class:`dict` objects and multiple function calls:
107107

108108
.. code-block:: python
109109
@@ -121,7 +121,7 @@ when dealing with deeply nested dictionary objects and multiple function calls,
121121
~~~~~~~~~~~~~~~~~~^^^^^
122122
TypeError: 'NoneType' object is not subscriptable
123123
124-
as well as complex arithmetic expressions:
124+
As well as complex arithmetic expressions:
125125

126126
.. code-block:: python
127127
@@ -135,12 +135,14 @@ See :pep:`657` for more details. (Contributed by Pablo Galindo, Batuhan Taskaya
135135
and Ammar Askar in :issue:`43950`.)
136136

137137
.. note::
138-
This feature requires storing column positions in code objects which may
139-
result in a small increase of disk usage of compiled Python files or
140-
interpreter memory usage. To avoid storing the extra information and/or
141-
deactivate printing the extra traceback information, the
142-
:option:`-X` ``no_debug_ranges`` command line flag or the :envvar:`PYTHONNODEBUGRANGES`
143-
environment variable can be used.
138+
This feature requires storing column positions in :ref:`codeobjects`,
139+
which may result in a small increase in interpreter memory usage
140+
and disk usage for compiled Python files.
141+
To avoid storing the extra information
142+
and deactivate printing the extra traceback information,
143+
use the :option:`-X no_debug_ranges <-X>` command line option
144+
or the :envvar:`PYTHONNODEBUGRANGES` environment variable.
145+
144146

145147
Column information for code objects
146148
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)