Skip to content

Commit be31ecf

Browse files
authored
gh-91058: Add what's new entry for the improvement in commit 7cfbb49 (#99198)
1 parent e02f1e2 commit be31ecf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Doc/whatsnew/3.12.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,16 @@ Improved Error Messages
106106
^^^^^^^^^^^^^^^^^^^^^^^
107107
SyntaxError: Did you mean to use 'from ... import ...' instead?
108108

109+
* :exc:`ImportError` exceptions raised from failed ``from <module> import
110+
<name>`` statements now include suggestions for the value of ``<name>`` based on the
111+
available names in ``<module>``. Contributed by Pablo Galindo in :gh:`91058`.
112+
113+
>>> from collections import chainmap
114+
Traceback (most recent call last):
115+
File "<stdin>", line 1, in <module>
116+
ImportError: cannot import name 'chainmap' from 'collections'. Did you mean: 'ChainMap'?
117+
118+
109119
New Features
110120
============
111121

0 commit comments

Comments
 (0)