]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91058: Add what's new entry for the improvement in commit 7cfbb49fcd4c85f9bab37973...
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Mon, 7 Nov 2022 13:36:48 +0000 (13:36 +0000)
committerGitHub <noreply@github.com>
Mon, 7 Nov 2022 13:36:48 +0000 (13:36 +0000)
Doc/whatsnew/3.12.rst

index 53c72e957d64ebb77fa4aa8f790ec821862cbbc8..3802d0e324143e9f106679578d6ee764dd6010b4 100644 (file)
@@ -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
 ============