Commits

Carl Meyer committed 6cc8a54 Draft Merge

Merge from upstream.

Comments (0)

Files changed (2)

 Content-Type: text/x-rst
 Created: 13-Jun-2011
 Python-Version: 3.3
-Post-History: 24-Oct-2011, 28-Oct-2011, 06-Mar-2012
+Post-History: 24-Oct-2011, 28-Oct-2011, 06-Mar-2012, 24-May-2012
+Resolution: http://mail.python.org/pipermail/python-dev/2012-May/119668.html
 
 
 Abstract
 Last-Modified: $Date$
 Author: Eric V. Smith <eric@trueblade.com>
 Status: Accepted
-Resolution: http://mail.python.org/pipermail/python-dev/2012-May/119651.html
 Type: Standards Track
 Content-Type: text/x-rst
 Created: 19-Apr-2012
 Python-Version: 3.3
 Post-History:
+Resolution: http://mail.python.org/pipermail/python-dev/2012-May/119651.html
 
 Abstract
 ========
                child
                    three.py
 
-We add the first two parent paths to ``sys.path``. The third
-``parent`` portion is added dynamically to ``parent.__path__``, and
-the third portion is then found when it is imported::
+We add ``project1`` and ``project2`` to ``sys.path``, then import
+``parent.child.one`` and ``parent.child.two``.  Then we add the
+``project3`` to ``sys.path`` and when ``parent.child.three`` is
+imported, ``project3/parent`` is automatically added to
+``parent.__path__``::
 
     # add the first two parent paths to sys.path
     >>> import sys
       File "<frozen importlib._bootstrap>", line 1250, in _find_and_load_unlocked
     ImportError: No module named 'parent.child.three'
 
-    # now add the third parent portion to parent.__path__:
-    >>> parent.__path__.append('Lib/test/namespace_pkgs/project3/parent')
-    >>> parent.__path__
-    _NamespacePath(['Lib/test/namespace_pkgs/project1/parent', 'Lib/test/namespace_pkgs/project2/parent', 'Lib/test/namespace_pkgs/project3/parent'])
+    # now add project3 to sys.path:
+    >>> sys.path.append('Lib/test/namespace_pkgs/project3')
 
     # and now parent.child.three can be imported:
     >>> import parent.child.three
 
-    # and project3/parent/child has dynamically been added to parent.child.__path__
+    # project3/parent has been added to parent.__path__:
+    >>> parent.__path__
+    _NamespacePath(['Lib/test/namespace_pkgs/project1/parent', 'Lib/test/namespace_pkgs/project2/parent', 'Lib/test/namespace_pkgs/project3/parent'])
+
+    # and project3/parent/child has been added to parent.child.__path__
     >>> parent.child.__path__
     _NamespacePath(['Lib/test/namespace_pkgs/project1/parent/child', 'Lib/test/namespace_pkgs/project2/parent/child', 'Lib/test/namespace_pkgs/project3/parent/child'])
+    >>>
+
 
 
 Discussion
   4. Implicit package directories will permanently entrench current
      newbie-hostile behavior in ``__main__``.
 
-Nick later gave a detailed response to his own objections[5]_, which
+Nick later gave a detailed response to his own objections [5]_, which
 is summarized here:
 
   1. The practicality of this PEP wins over other proposals and the
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.