]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-68654: Clarify subdirectories used by pkgutil.extend_path (#103701)
authorRandy <69558016+san-juan1667@users.noreply.github.com>
Sat, 22 Apr 2023 23:33:50 +0000 (17:33 -0600)
committerGitHub <noreply@github.com>
Sat, 22 Apr 2023 23:33:50 +0000 (17:33 -0600)
Clarify sub directories used by pkgutil.extend_path in the docs and the docstring

Doc/library/pkgutil.rst
Lib/pkgutil.py

index 788a02dcb8922f0dab29a0cc66d9eebe7c5a7109..66d753bd1a3c6ce63becfe7ecb35dbe9e62a8b55 100644 (file)
@@ -25,9 +25,9 @@ support.
       from pkgutil import extend_path
       __path__ = extend_path(__path__, __name__)
 
-   This will add to the package's ``__path__`` all subdirectories of directories
-   on :data:`sys.path` named after the package.  This is useful if one wants to
-   distribute different parts of a single logical package as multiple
+   For each directory on :data:`sys.path` that has a subdirectory that matches the
+   package name, add the subdirectory to the package's :attr:`__path__`.  This is useful
+   if one wants to distribute different parts of a single logical package as multiple
    directories.
 
    It also looks for :file:`\*.pkg` files beginning where ``*`` matches the
index bdebfd2fc8ac329a2a2b73d82b36920a45ea2440..56731de64af494f6170a1446909c8625985d9224 100644 (file)
@@ -511,10 +511,10 @@ def extend_path(path, name):
         from pkgutil import extend_path
         __path__ = extend_path(__path__, __name__)
 
-    This will add to the package's __path__ all subdirectories of
-    directories on sys.path named after the package.  This is useful
-    if one wants to distribute different parts of a single logical
-    package as multiple directories.
+    For each directory on sys.path that has a subdirectory that
+    matches the package name, add the subdirectory to the package's
+    __path__.  This is useful if one wants to distribute different
+    parts of a single logical package as multiple directories.
 
     It also looks for *.pkg files beginning where * matches the name
     argument.  This feature is similar to *.pth files (see site.py),