diff options
author | Guido van Rossum <guido@python.org> | 2001-01-12 16:25:08 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-01-12 16:25:08 (GMT) |
commit | 1cc8f836660c0c7cfd1ca24a58a45531112a1e44 (patch) | |
tree | 64c11839d4c02e6f6fe420c4df9a2e35af7d2ee9 /Misc | |
parent | 18d4d8f71dca03a99220623d7eb4a5af733796e3 (diff) | |
download | cpython-1cc8f836660c0c7cfd1ca24a58a45531112a1e44.zip cpython-1cc8f836660c0c7cfd1ca24a58a45531112a1e44.tar.gz cpython-1cc8f836660c0c7cfd1ca24a58a45531112a1e44.tar.bz2 |
News about from...import.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -3,6 +3,17 @@ What's New in Python 2.1 alpha 1? Core language, builtins, and interpreter +- Two changes to from...import: + + 1) "from M import X" now works even if M is not a real module; it's + basically a getattr() operation with AttributeError exceptions + changed into ImportError. + + 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 + filters out names starting with '_' as before. Whether or not + __all__ exists, there's no restriction on the type of M. + - File objects have a new method, xreadlines(). This is the fastest way to iterate over all lines in a file: |