[Python-checkins] CVS: python/dist/src/Misc NEWS,1.91,1.92
Guido van Rossum
python-dev@python.org
Fri, 12 Jan 2001 08:25:10 -0800
Update of /cvsroot/python/python/dist/src/Misc
In directory usw-pr-cvs1:/tmp/cvs-serv2518
Modified Files:
NEWS
Log Message:
News about from...import.
Index: NEWS
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v
retrieving revision 1.91
retrieving revision 1.92
diff -C2 -r1.91 -r1.92
*** NEWS 2001/01/11 15:00:14 1.91
--- NEWS 2001/01/12 16:25:08 1.92
***************
*** 4,7 ****
--- 4,18 ----
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: