Clarify the news item about "from M import X" if "M is not a real

module" after a complaint from Tim.
This commit is contained in:
Guido van Rossum 2001-02-03 15:06:40 +00:00
parent cf2636696d
commit ba38123b75
1 changed files with 3 additions and 3 deletions

View File

@ -188,9 +188,9 @@ Core language, builtins, and interpreter
- Two changes to from...import: - Two changes to from...import:
1) "from M import X" now works even if M is not a real module; it's 1) "from M import X" now works even if (after loading module M)
basically a getattr() operation with AttributeError exceptions sys.modules['M'] is not a real module; it's basically a getattr()
changed into ImportError. operation with AttributeError exceptions changed into ImportError.
2) "from M import *" now looks for M.__all__ to decide which names to 2) "from M import *" now looks for M.__all__ to decide which names to
import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but