Skip to content

Commit 6168e71

Browse files
authored
gh-98254: Add what's new entry for the improvement in commit bb56dea (#99197)
1 parent be31ecf commit 6168e71

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Doc/whatsnew/3.12.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ Important deprecations, removals or restrictions:
7575
Improved Error Messages
7676
=======================
7777

78+
* Modules from the standard library are now potentially suggested as part of
79+
the error messages displayed by the interpreter when a :exc:`NameError` is
80+
raised to the top level. Contributed by Pablo Galindo in :gh:`98254`.
81+
82+
>>> sys.version_info
83+
Traceback (most recent call last):
84+
File "<stdin>", line 1, in <module>
85+
NameError: name 'sys' is not defined. Did you forget to import 'sys'?
86+
7887
* Improve the error suggestion for :exc:`NameError` exceptions for instances.
7988
Now if a :exc:`NameError` is raised in a method and the instance has an
8089
attribute that's exactly equal to the name in the exception, the suggestion

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy