[Python-checkins] cpython: Add some comments.

brett.cannon python-checkins at python.org
Fri Sep 28 22:41:45 CEST 2012


http://hg.python.org/cpython/rev/4a979326e6d6
changeset:   79228:4a979326e6d6
parent:      79225:f3bd51cdd958
user:        Brett Cannon <brett at python.org>
date:        Fri Sep 28 16:41:39 2012 -0400
summary:
  Add some comments.

files:
  Lib/importlib/_bootstrap.py |     4 +
  Python/importlib.h          |  6991 +++++++++++-----------
  2 files changed, 3499 insertions(+), 3496 deletions(-)


diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -1669,7 +1669,11 @@
         elif not name:
             return module
         else:
+            # Figure out where to slice the module's name up to the first dot
+            # in 'name'.
             cut_off = len(name) - len(name.partition('.')[0])
+            # Slice end needs to be positive to alleviate need to special-case
+            # when ``'.' not in name``.
             return sys.modules[module.__name__[:len(module.__name__)-cut_off]]
     else:
         return _handle_fromlist(module, fromlist, _gcd_import)
diff --git a/Python/importlib.h b/Python/importlib.h
--- a/Python/importlib.h
+++ b/Python/importlib.h
[stripped]

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list