Skip to content

Commit

Permalink
Clarify sub directories used by pkgutil extend_path
Browse files Browse the repository at this point in the history
  • Loading branch information
san-juan1667 committed Apr 22, 2023
1 parent ea2c001 commit ec040e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Doc/library/pkgutil.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Lib/pkgutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit ec040e2

Please sign in to comment.