gh-98254: Add what's new entry for the improvement in commit bb56dead33 (#99197)

This commit is contained in:
Pablo Galindo Salgado 2022-11-07 13:37:14 +00:00 committed by GitHub
parent be31ecf8b3
commit 6168e714be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -75,6 +75,15 @@ Important deprecations, removals or restrictions:
Improved Error Messages
=======================
* Modules from the standard library are now potentially suggested as part of
the error messages displayed by the interpreter when a :exc:`NameError` is
raised to the top level. Contributed by Pablo Galindo in :gh:`98254`.
>>> sys.version_info
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'sys' is not defined. Did you forget to import 'sys'?
* Improve the error suggestion for :exc:`NameError` exceptions for instances.
Now if a :exc:`NameError` is raised in a method and the instance has an
attribute that's exactly equal to the name in the exception, the suggestion