Skip to content

Commit cd506a4

Browse files
committed
Mention the path argument in the documentation
Signed-off-by: Filipe Laíns <lains@riseup.net>
1 parent 06b8906 commit cd506a4

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

Doc/library/importlib.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -987,11 +987,14 @@ find and load modules.
987987

988988
.. class:: NamespacePath(name, path, path_finder)
989989

990-
Represents a namespace package's path. It uses the module *name* to find its
991-
parent module, and from there it looks up the parent's
992-
:attr:`module.__path__`. When this changes, the module's own path is
993-
recomputed, using *path_finder*. For top-level modules, the parent module's
994-
path is :data:`sys.path`.
990+
Represents a namespace package's path.
991+
992+
It uses the module *name* to find its parent module, and from there it looks
993+
up the parent's :attr:`module.__path__`. When this changes, the module's own
994+
path is recomputed, using *path_finder*. The initial package path value is
995+
set to *path*.
996+
997+
For top-level modules, the parent module's path is :data:`sys.path`.
995998

996999

9971000
.. class:: SourceFileLoader(fullname, path)

Lib/importlib/_bootstrap_external.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,11 +1080,14 @@ def get_filename(self, fullname):
10801080

10811081

10821082
class NamespacePath:
1083-
"""Represents a namespace package's path. It uses the module name
1084-
to find its parent module, and from there it looks up the parent's
1085-
__path__. When this changes, the module's own path is recomputed,
1086-
using path_finder. For top-level modules, the parent module's path
1087-
is sys.path."""
1083+
"""Represents a namespace package's path.
1084+
1085+
It uses the module name to find its parent module, and from there it looks
1086+
up the parent's __path__. When this changes, the module's own path is
1087+
recomputed, using path_finder. The initial package path value is set to path.
1088+
1089+
For top-level modules, the parent module's path is sys.path.
1090+
"""
10881091

10891092
# When invalidate_caches() is called, this epoch is incremented
10901093
# https://bugs.python.org/issue45703

0 commit comments

Comments
 (0)