Skip to content

Commit d469147

Browse files
authored
PEP-657: Mark PEP657 as final (GH-2032)
1 parent 589b945 commit d469147

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pep-0657.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Author: Pablo Galindo <[email protected]>,
66
Batuhan Taskaya <[email protected]>,
77
Ammar Askar <[email protected]>
88
Discussions-To: https://discuss.python.org/t/pep-657-include-fine-grained-error-locations-in-tracebacks/8629
9-
Status: Accepted
9+
Status: Final
1010
Type: Standards Track
1111
Content-Type: text/x-rst
1212
Created: 08-May-2021
@@ -56,7 +56,7 @@ as line numbers, it could helpfully display::
5656
Traceback (most recent call last):
5757
File "test.py", line 2, in <module>
5858
x['a']['b']['c']['d'] = 1
59-
^^^^^^^^^^^^^^^^
59+
~~~~~~~~~~~^^^^^
6060
TypeError: 'NoneType' object is not subscriptable
6161

6262
indicating to the user that the object ``x['a']['b']`` must have been ``None``.
@@ -76,7 +76,7 @@ display the code associated to the current instruction in every frame::
7676
^^^^^^
7777
File "test.py", line 6, in lel
7878
return 1 + foo(a,b,c=x['z']['x']['y']['z']['y'], d=e)
79-
^^^^^^^^^^^^^^^^^^^^^
79+
~~~~~~~~~~~~~~~~^^^^^
8080
TypeError: 'NoneType' object is not subscriptable
8181

8282
This problem presents itself in the following situations.
@@ -114,7 +114,7 @@ This problem presents itself in the following situations.
114114
Traceback (most recent call last):
115115
File "test.py", line 1, in <module>
116116
x = (a + b) @ (c + d)
117-
^^^^^
117+
~~^~~
118118
ValueError: operands could not be broadcast together with shapes (1,2) (2,3)
119119

120120
Giving a much clearer and easier to debug error message.
@@ -240,7 +240,7 @@ available. For instance::
240240

241241
File "test.py", line 6, in lel
242242
return 1 + foo(a,b,c=x['z']['x']['y']['z']['y'], d=e)
243-
^^^^^^^^^^^^^^^^^^^^^
243+
~~~~~~~~~~~~~~~~^^^^^
244244
TypeError: 'NoneType' object is not subscriptable
245245

246246
When displaying tracebacks, instruction offsets will be taken from the
@@ -267,7 +267,7 @@ The printed traceback would look like this::
267267
^^^^^^
268268
File "test.py", line 2, in foo
269269
1 + 1/0 + 2
270-
^^^
270+
~^~
271271
ZeroDivisionError: division by zero
272272

273273
The above exception was the direct cause of the following exception:
@@ -303,7 +303,7 @@ Will be displayed as::
303303
^^^^^^
304304
File "test.py", line 2, in foo
305305
1 + 1/0 + 2
306-
^^^
306+
~^~
307307
ZeroDivisionError: division by zero
308308

309309
Maintaining the current behavior, only a single line will be displayed

0 commit comments

Comments
 (0)