Skip to content

Commit d0e8c28

Browse files
committed
3.11 Whatsnew: Revise desc of enhanced error locations feature
1 parent 32ac98e commit d0e8c28

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

Doc/whatsnew/3.11.rst

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ New Features
102102

103103
.. _whatsnew311-pep657:
104104

105-
Enhanced error locations in tracebacks
106-
--------------------------------------
105+
PEP 657: Enhanced error locations in tracebacks
106+
-----------------------------------------------
107107

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

111111
.. code-block:: python
112112
@@ -119,9 +119,9 @@ that caused the error instead of just the line. For example:
119119
^^^^^^^^^
120120
AttributeError: 'NoneType' object has no attribute 'x'
121121
122-
Previous versions of the interpreter would point to just the line making it
122+
Previous versions of the interpreter would point to just the line, making it
123123
ambiguous which object was ``None``. These enhanced errors can also be helpful
124-
when dealing with deeply nested dictionary objects and multiple function calls,
124+
when dealing with deeply nested :class:`dict` objects and multiple function calls:
125125

126126
.. code-block:: python
127127
@@ -139,7 +139,7 @@ when dealing with deeply nested dictionary objects and multiple function calls,
139139
~~~~~~~~~~~~~~~~~~^^^^^
140140
TypeError: 'NoneType' object is not subscriptable
141141
142-
as well as complex arithmetic expressions:
142+
As well as complex arithmetic expressions:
143143

144144
.. code-block:: python
145145
@@ -153,12 +153,14 @@ See :pep:`657` for more details. (Contributed by Pablo Galindo, Batuhan Taskaya
153153
and Ammar Askar in :issue:`43950`.)
154154

155155
.. note::
156-
This feature requires storing column positions in code objects which may
157-
result in a small increase of disk usage of compiled Python files or
158-
interpreter memory usage. To avoid storing the extra information and/or
159-
deactivate printing the extra traceback information, the
160-
:option:`-X` ``no_debug_ranges`` command line flag or the :envvar:`PYTHONNODEBUGRANGES`
161-
environment variable can be used.
156+
This feature requires storing column positions in :ref:`codeobjects`,
157+
which may result in a small increase in interpreter memory usage
158+
and disk usage for compiled Python files.
159+
To avoid storing the extra information
160+
and deactivate printing the extra traceback information,
161+
use the :option:`-X no_debug_ranges <-X>` command line option
162+
or the :envvar:`PYTHONNODEBUGRANGES` environment variable.
163+
162164

163165
Column information for code objects
164166
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)