[Python-checkins] peps: Restore whitespace characters lost via email transmission.

phillip.eby python-checkins at python.org
Wed Jul 20 16:03:28 CEST 2011


http://hg.python.org/peps/rev/728660b53208
changeset:   3903:728660b53208
user:        pje
date:        Wed Jul 20 09:56:48 2011 -0400
summary:
  Restore whitespace characters lost via email transmission.

files:
  pep-0402.txt |  56 ++++++++++++++++++++--------------------
  1 files changed, 28 insertions(+), 28 deletions(-)


diff --git a/pep-0402.txt b/pep-0402.txt
--- a/pep-0402.txt
+++ b/pep-0402.txt
@@ -38,13 +38,13 @@
 
 .. epigraph::
 
-   "Most packages are like modules.  Their contents are highly
-   interdependent and can't be pulled apart.  [However,] some
-   packages exist to provide a separate namespace. ...  It should
-   be possible to distribute sub-packages or submodules of these
-   [namespace packages] independently."
+    "Most packages are like modules.  Their contents are highly
+    interdependent and can't be pulled apart.  [However,] some
+    packages exist to provide a separate namespace. ...  It should
+    be possible to distribute sub-packages or submodules of these
+    [namespace packages] independently."
 
-   -- Jim Fulton, shortly before the release of Python 2.3 [1]_
+    -- Jim Fulton, shortly before the release of Python 2.3 [1]_
 
 
 When new users come to Python from other languages, they are often
@@ -413,23 +413,23 @@
 
 In Python code, the algorithm would look something like this::
 
-   def get_virtual_path(modulename, parent_path=None):
+    def get_virtual_path(modulename, parent_path=None):
 
-       if parent_path is None:
-           parent_path = sys.path
+        if parent_path is None:
+            parent_path = sys.path
 
-       path = []
+        path = []
 
-       for entry in parent_path:
-           # Obtain a PEP 302 importer object - see pkgutil module
-           importer = pkgutil.get_importer(entry)
+        for entry in parent_path:
+            # Obtain a PEP 302 importer object - see pkgutil module
+            importer = pkgutil.get_importer(entry)
 
-           if hasattr(importer, 'get_subpath'):
-               subpath = importer.get_subpath(modulename)
-               if subpath is not None:
-                   path.append(subpath)
+            if hasattr(importer, 'get_subpath'):
+                subpath = importer.get_subpath(modulename)
+                if subpath is not None:
+                    path.append(subpath)
 
-       return path
+        return path
 
 And a function like this one should be exposed in the standard
 library as e.g. ``imp.get_virtual_path()``, so that people creating
@@ -563,10 +563,10 @@
 ==========
 
 .. [1] "namespace" vs "module" packages (mailing list thread)
-  (http://mail.zope.org/pipermail/zope3-dev/2002-December/004251.html)
+   (http://mail.zope.org/pipermail/zope3-dev/2002-December/004251.html)
 
 .. [2] "Dropping __init__.py requirement for subpackages"
-  (http://mail.python.org/pipermail/python-dev/2006-April/064400.html)
+   (http://mail.python.org/pipermail/python-dev/2006-April/064400.html)
 
 
 Copyright
@@ -574,12 +574,12 @@
 
 This document has been placed in the public domain.
 
-
+
 ..
-  Local Variables:
-  mode: indented-text
-  indent-tabs-mode: nil
-  sentence-end-double-space: t
-  fill-column: 70
-  coding: utf-8
-  End:
+   Local Variables:
+   mode: indented-text
+   indent-tabs-mode: nil
+   sentence-end-double-space: t
+   fill-column: 70
+   coding: utf-8
+   End:

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


More information about the Python-checkins mailing list