@@ -102,11 +102,11 @@ New Features
102
102
103
103
.. _whatsnew311-pep657 :
104
104
105
- Enhanced error locations in tracebacks
106
- --------------------------------------
105
+ PEP 657: Enhanced error locations in tracebacks
106
+ -----------------------------------------------
107
107
108
108
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:
110
110
111
111
.. code-block :: python
112
112
@@ -119,9 +119,9 @@ that caused the error instead of just the line. For example:
119
119
^^^^^^^^^
120
120
AttributeError : ' NoneType' object has no attribute ' x'
121
121
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
123
123
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:
125
125
126
126
.. code-block :: python
127
127
@@ -139,7 +139,7 @@ when dealing with deeply nested dictionary objects and multiple function calls,
139
139
~~~~~~~~~~~~~~~~~~^^^^^
140
140
TypeError : ' NoneType' object is not subscriptable
141
141
142
- as well as complex arithmetic expressions:
142
+ As well as complex arithmetic expressions:
143
143
144
144
.. code-block :: python
145
145
@@ -153,12 +153,14 @@ See :pep:`657` for more details. (Contributed by Pablo Galindo, Batuhan Taskaya
153
153
and Ammar Askar in :issue: `43950 `.)
154
154
155
155
.. 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
+
162
164
163
165
Column information for code objects
164
166
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments