From d46914776888c512d0469122e7b48daff61544aa Mon Sep 17 00:00:00 2001 From: Ammar Askar Date: Fri, 16 Jul 2021 22:25:16 -0400 Subject: [PATCH] PEP-657: Mark PEP657 as final (GH-2032) --- pep-0657.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pep-0657.rst b/pep-0657.rst index e161deb55..255911e3a 100644 --- a/pep-0657.rst +++ b/pep-0657.rst @@ -6,7 +6,7 @@ Author: Pablo Galindo , Batuhan Taskaya , Ammar Askar 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 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 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