summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-04-14 14:10:33 (GMT)
committerGitHub <noreply@github.com>2021-04-14 14:10:33 (GMT)
commit5bf8bf2267cd109970b2d946d43b2e9f71379ba2 (patch)
treea29b493cace0ba9cf1d5af516750ff9348ce6c49 /Doc/whatsnew
parentc4073a24f95b54705416138dc1f20141ad76dd37 (diff)
downloadcpython-5bf8bf2267cd109970b2d946d43b2e9f71379ba2.zip
cpython-5bf8bf2267cd109970b2d946d43b2e9f71379ba2.tar.gz
cpython-5bf8bf2267cd109970b2d946d43b2e9f71379ba2.tar.bz2
bpo-38530: Offer suggestions on NameError (GH-25397)
When printing NameError raised by the interpreter, PyErr_Display will offer suggestions of simmilar variable names in the function that the exception was raised from: >>> schwarzschild_black_hole = None >>> schwarschild_black_hole Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'schwarschild_black_hole' is not defined. Did you mean: schwarzschild_black_hole?
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/3.10.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst
index f149d74..69697e1 100644
--- a/Doc/whatsnew/3.10.rst
+++ b/Doc/whatsnew/3.10.rst
@@ -187,6 +187,23 @@ raised from:
(Contributed by Pablo Galindo in :issue:`38530`.)
+NameErrors
+~~~~~~~~~~
+
+When printing :exc:`NameError` raised by the interpreter, :c:func:`PyErr_Display`
+will offer suggestions of simmilar variable names in the function that the exception
+was raised from:
+
+.. code-block:: python
+
+ >>> schwarzschild_black_hole = None
+ >>> schwarschild_black_hole
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ NameError: name 'schwarschild_black_hole' is not defined. Did you mean: schwarzschild_black_hole?
+
+(Contributed by Pablo Galindo in :issue:`38530`.)
+
PEP 626: Precise line numbers for debugging and other tools
-----------------------------------------------------------