mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
News about from...import.
This commit is contained in:
parent
18d4d8f71d
commit
1cc8f83666
1 changed files with 11 additions and 0 deletions
11
Misc/NEWS
11
Misc/NEWS
|
@ -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:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue