]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-38530: Offer suggestions on NameError (GH-25397)
authorPablo Galindo <Pablogsal@gmail.com>
Wed, 14 Apr 2021 14:10:33 +0000 (15:10 +0100)
committerGitHub <noreply@github.com>
Wed, 14 Apr 2021 14:10:33 +0000 (15:10 +0100)
commit5bf8bf2267cd109970b2d946d43b2e9f71379ba2
treea29b493cace0ba9cf1d5af516750ff9348ce6c49
parentc4073a24f95b54705416138dc1f20141ad76dd37
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?
Doc/library/exceptions.rst
Doc/whatsnew/3.10.rst
Include/cpython/pyerrors.h
Lib/test/test_exceptions.py
Misc/NEWS.d/next/Core and Builtins/2021-04-14-03-53-06.bpo-38530.rNI_G1.rst [new file with mode: 0644]
Objects/exceptions.c
Python/ceval.c
Python/suggestions.c