PEP-657: Mark PEP657 as final (GH-2032)

This commit is contained in:
Ammar Askar 2021-07-16 22:25:16 -04:00 committed by GitHub
parent 589b945e30
commit d469147768
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -6,7 +6,7 @@ Author: Pablo Galindo <pablogsal@python.org>,
Batuhan Taskaya <batuhan@python.org>,
Ammar Askar <ammar@ammaraskar.com>
Discussions-To: https://discuss.python.org/t/pep-657-include-fine-grained-error-locations-in-tracebacks/8629
Status: Accepted
Status: Final
Type: Standards Track
Content-Type: text/x-rst
Created: 08-May-2021
@ -56,7 +56,7 @@ as line numbers, it could helpfully display::
Traceback (most recent call last):
File "test.py", line 2, in <module>
x['a']['b']['c']['d'] = 1
^^^^^^^^^^^^^^^^
~~~~~~~~~~~^^^^^
TypeError: 'NoneType' object is not subscriptable
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::
^^^^^^
File "test.py", line 6, in lel
return 1 + foo(a,b,c=x['z']['x']['y']['z']['y'], d=e)
^^^^^^^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~~^^^^^
TypeError: 'NoneType' object is not subscriptable
This problem presents itself in the following situations.
@ -114,7 +114,7 @@ This problem presents itself in the following situations.
Traceback (most recent call last):
File "test.py", line 1, in <module>
x = (a + b) @ (c + d)
^^^^^
~~^~~
ValueError: operands could not be broadcast together with shapes (1,2) (2,3)
Giving a much clearer and easier to debug error message.
@ -240,7 +240,7 @@ available. For instance::
File "test.py", line 6, in lel
return 1 + foo(a,b,c=x['z']['x']['y']['z']['y'], d=e)
^^^^^^^^^^^^^^^^^^^^^
~~~~~~~~~~~~~~~~^^^^^
TypeError: 'NoneType' object is not subscriptable
When displaying tracebacks, instruction offsets will be taken from the
@ -267,7 +267,7 @@ The printed traceback would look like this::
^^^^^^
File "test.py", line 2, in foo
1 + 1/0 + 2
^^^
~^~
ZeroDivisionError: division by zero
The above exception was the direct cause of the following exception:
@ -303,7 +303,7 @@ Will be displayed as::
^^^^^^
File "test.py", line 2, in foo
1 + 1/0 + 2
^^^
~^~
ZeroDivisionError: division by zero
Maintaining the current behavior, only a single line will be displayed