Clarifications.
This commit is contained in:
parent
4e8c94b358
commit
a04b8eb10b
|
@ -370,9 +370,9 @@ portion::
|
||||||
child
|
child
|
||||||
three.py
|
three.py
|
||||||
|
|
||||||
We add the first two parent paths to ``sys.path``. The third portion
|
We add the first two parent paths to ``sys.path``. The third
|
||||||
is added dynamically to the parent's ``__path__``, and the third
|
``parent`` portion is added dynamically to ``parent.__path__``, and
|
||||||
portion is found when it is imported::
|
the third portion is then found when it is imported::
|
||||||
|
|
||||||
# add the first two parent paths to sys.path
|
# add the first two parent paths to sys.path
|
||||||
>>> import sys
|
>>> import sys
|
||||||
|
@ -398,7 +398,7 @@ portion is found when it is imported::
|
||||||
File "<frozen importlib._bootstrap>", line 1250, in _find_and_load_unlocked
|
File "<frozen importlib._bootstrap>", line 1250, in _find_and_load_unlocked
|
||||||
ImportError: No module named 'parent.child.three'
|
ImportError: No module named 'parent.child.three'
|
||||||
|
|
||||||
# now add parent3 to the parent's __path__:
|
# now add the third parent portion to parent.__path__:
|
||||||
>>> parent.__path__.append('Lib/test/namespace_pkgs/parent3/parent')
|
>>> parent.__path__.append('Lib/test/namespace_pkgs/parent3/parent')
|
||||||
|
|
||||||
# and now parent.child.three can be imported:
|
# and now parent.child.three can be imported:
|
||||||
|
|
Loading…
Reference in New Issue