[Python-checkins] gh-91058: Add what's new entry for the improvement in commit 7cfbb49fcd4c85f9bab3797302eadf93df490344 (#99198)

pablogsal webhook-mailer at python.org
Mon Nov 7 08:37:05 EST 2022


https://github.com/python/cpython/commit/be31ecf8b3a3ceadf947a9a5c6dbc8150527cb0c
commit: be31ecf8b3a3ceadf947a9a5c6dbc8150527cb0c
branch: main
author: Pablo Galindo Salgado <Pablogsal at gmail.com>
committer: pablogsal <Pablogsal at gmail.com>
date: 2022-11-07T13:36:48Z
summary:

gh-91058: Add what's new entry for the improvement in commit 7cfbb49fcd4c85f9bab3797302eadf93df490344 (#99198)

files:
M Doc/whatsnew/3.12.rst

diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst
index 53c72e957d64..3802d0e32414 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
 ============
 



More information about the Python-checkins mailing list