mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.11] gh-68654: Clarify subdirectories used by pkgutil.extend_path (GH-103701)
gh-68654: Clarify subdirectories used by pkgutil.extend_path (GH-103701)
Clarify sub directories used by pkgutil.extend_path in the docs and the docstring
(cherry picked from commit 7bf94568a9)
Co-authored-by: Randy <69558016+san-juan1667@users.noreply.github.com>
This commit is contained in:
parent
050b6b34d0
commit
a43dbe13e2
2 changed files with 7 additions and 7 deletions
|
|
@ -25,9 +25,9 @@ support.
|
||||||
from pkgutil import extend_path
|
from pkgutil import extend_path
|
||||||
__path__ = extend_path(__path__, __name__)
|
__path__ = extend_path(__path__, __name__)
|
||||||
|
|
||||||
This will add to the package's ``__path__`` all subdirectories of directories
|
For each directory on :data:`sys.path` that has a subdirectory that matches the
|
||||||
on :data:`sys.path` named after the package. This is useful if one wants to
|
package name, add the subdirectory to the package's :attr:`__path__`. This is useful
|
||||||
distribute different parts of a single logical package as multiple
|
if one wants to distribute different parts of a single logical package as multiple
|
||||||
directories.
|
directories.
|
||||||
|
|
||||||
It also looks for :file:`\*.pkg` files beginning where ``*`` matches the
|
It also looks for :file:`\*.pkg` files beginning where ``*`` matches the
|
||||||
|
|
|
||||||
|
|
@ -511,10 +511,10 @@ def extend_path(path, name):
|
||||||
from pkgutil import extend_path
|
from pkgutil import extend_path
|
||||||
__path__ = extend_path(__path__, __name__)
|
__path__ = extend_path(__path__, __name__)
|
||||||
|
|
||||||
This will add to the package's __path__ all subdirectories of
|
For each directory on sys.path that has a subdirectory that
|
||||||
directories on sys.path named after the package. This is useful
|
matches the package name, add the subdirectory to the package's
|
||||||
if one wants to distribute different parts of a single logical
|
__path__. This is useful if one wants to distribute different
|
||||||
package as multiple directories.
|
parts of a single logical package as multiple directories.
|
||||||
|
|
||||||
It also looks for *.pkg files beginning where * matches the name
|
It also looks for *.pkg files beginning where * matches the name
|
||||||
argument. This feature is similar to *.pth files (see site.py),
|
argument. This feature is similar to *.pth files (see site.py),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue