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