Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba38123

Browse files
committed
Clarify the news item about "from M import X" if "M is not a real
module" after a complaint from Tim.
1 parent cf26366 commit ba38123

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ Core language, builtins, and interpreter
188188

189189
- Two changes to from...import:
190190

191-
1) "from M import X" now works even if M is not a real module; it's
192-
basically a getattr() operation with AttributeError exceptions
193-
changed into ImportError.
191+
1) "from M import X" now works even if (after loading module M)
192+
sys.modules['M'] is not a real module; it's basically a getattr()
193+
operation with AttributeError exceptions changed into ImportError.
194194

195195
2) "from M import *" now looks for M.__all__ to decide which names to
196196
import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but

0 commit comments

Comments
 (0)