[Python-checkins] r52806 - sandbox/trunk/import_in_py/importer.py

brett.cannon python-checkins at python.org
Mon Nov 20 21:45:28 CET 2006


Author: brett.cannon
Date: Mon Nov 20 21:45:28 2006
New Revision: 52806

Modified:
   sandbox/trunk/import_in_py/importer.py
Log:
Add notes about doing a relative import based on fromlist/__all__.


Modified: sandbox/trunk/import_in_py/importer.py
==============================================================================
--- sandbox/trunk/import_in_py/importer.py	(original)
+++ sandbox/trunk/import_in_py/importer.py	Mon Nov 20 21:45:28 2006
@@ -30,13 +30,15 @@
 =============
 Packages
 --------
-* ``from ... import ...`` first checks that fromlist is from module specified
-  or is a list of modules to import [package essay].
+* ``from ... import ...`` first checks that fromlist is attributes from the
+  module specified or is a list of modules to import  for a package
+  [package essay].
     + If already an attribute, then everything is fine.
     + If not an attribute, treat as a relative import and do import.
         - Newly imported module should end up as an attribute as is needed.
     + Same treatment for any existence of '*' in fromlist if __all__ defined
       for the module.
+    + Any failure on the part of the import is suppressed.
 * ``from ... import *`` for packages uses __all__ as a list of modules to be
   imported; if no __all__ is defined then the attributes on the packages are
   bound in the namespace (including previously imported modules)


More information about the Python-checkins mailing list