diff options
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.12.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 53c72e9..3802d0e 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -106,6 +106,16 @@ Improved Error Messages ^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Did you mean to use 'from ... import ...' instead? +* :exc:`ImportError` exceptions raised from failed ``from <module> import + <name>`` statements now include suggestions for the value of ``<name>`` based on the + available names in ``<module>``. Contributed by Pablo Galindo in :gh:`91058`. + + >>> from collections import chainmap + Traceback (most recent call last): + File "<stdin>", line 1, in <module> + ImportError: cannot import name 'chainmap' from 'collections'. Did you mean: 'ChainMap'? + + New Features ============ |