Minor edits to Python implicit namespace package docs
This commit is contained in:
parent
5ceef0a813
commit
4253740d40
2 changed files with 11 additions and 4 deletions
|
|
@ -116,6 +116,7 @@
|
|||
<li><a href="#Python_absrelimports">Absolute and relative imports</a>
|
||||
<li><a href="#Python_absimport">Enforcing absolute import semantics</a>
|
||||
<li><a href="#Python_importfrominit">Importing from __init__.py</a>
|
||||
<li><a href="#Python_implicit_namespace_packages">Implicit Namespace Packages</a>
|
||||
</ul>
|
||||
<li><a href="#Python_python3support">Python 3 Support</a>
|
||||
<ul>
|
||||
|
|
@ -5865,9 +5866,10 @@ class Bar(pkg3.foo.Foo): pass
|
|||
effect (note, that the Python 2 case also needs the <tt>-relativeimport</tt>
|
||||
workaround).</p>
|
||||
|
||||
<H3>Implicit Namespace Packages</H3>
|
||||
<H3><a name="Python_implicit_namespace_packages">36.11.5 Implicit Namespace Packages</a></H3>
|
||||
|
||||
<p> Python 3.3 intoduced
|
||||
|
||||
<p> Python 3.3 introduced
|
||||
<a href="https://www.python.org/dev/peps/pep-0420/">PEP 0420</a> which
|
||||
implements implicit namespace packages. In a nutshell, implicit namespace
|
||||
packages remove the requirement of an __init__.py file and allow packages
|
||||
|
|
@ -5884,11 +5886,11 @@ to be split across multiple PATH elements. For example:
|
|||
|
||||
<p>If PYTHONPATH is set to "/fragment1:/fragment2:/fragment3", then mod1, mod2
|
||||
and mod3 will be part of pkg1. This allows for splitting of packages into
|
||||
separate pieces. This can be useful for swig generated wrappers in the
|
||||
separate pieces. This can be useful for SWIG generated wrappers in the
|
||||
following way.
|
||||
</p>
|
||||
|
||||
<p> Suppose you create a swig wrapper for a module called robin. The swig
|
||||
<p> Suppose you create a SWIG wrapper for a module called robin. The SWIG
|
||||
generated code consists of two files robin.py and _robin.so. You wish to
|
||||
make these modules part of a subpackage (brave.sir). With implicit namespace
|
||||
packages you can place these files in the following configurations:
|
||||
|
|
@ -5937,6 +5939,10 @@ brave/sir/robin.py
|
|||
zipimporter requires python-3.5.1 or newer to work with subpackages.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Compatibility Note:</b> Support for implicit namespace packages was added in SWIG-3.0.9.
|
||||
</p>
|
||||
|
||||
<H2><a name="Python_python3support">36.12 Python 3 Support</a></H2>
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue