Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7bf9456

Browse filesBrowse files
authored
gh-68654: Clarify subdirectories used by pkgutil.extend_path (#103701)
Clarify sub directories used by pkgutil.extend_path in the docs and the docstring
1 parent 8cb2b0f commit 7bf9456
Copy full SHA for 7bf9456

File tree

2 files changed

+7
-7
lines changed
Filter options

2 files changed

+7
-7
lines changed

‎Doc/library/pkgutil.rst

Copy file name to clipboardExpand all lines: Doc/library/pkgutil.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ support.
2525
from pkgutil import extend_path
2626
__path__ = extend_path(__path__, __name__)
2727

28-
This will add to the package's ``__path__`` all subdirectories of directories
29-
on :data:`sys.path` named after the package. This is useful if one wants to
30-
distribute different parts of a single logical package as multiple
28+
For each directory on :data:`sys.path` that has a subdirectory that matches the
29+
package name, add the subdirectory to the package's :attr:`__path__`. This is useful
30+
if one wants to distribute different parts of a single logical package as multiple
3131
directories.
3232

3333
It also looks for :file:`\*.pkg` files beginning where ``*`` matches the

‎Lib/pkgutil.py

Copy file name to clipboardExpand all lines: Lib/pkgutil.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,10 @@ def extend_path(path, name):
511511
from pkgutil import extend_path
512512
__path__ = extend_path(__path__, __name__)
513513
514-
This will add to the package's __path__ all subdirectories of
515-
directories on sys.path named after the package. This is useful
516-
if one wants to distribute different parts of a single logical
517-
package as multiple directories.
514+
For each directory on sys.path that has a subdirectory that
515+
matches the package name, add the subdirectory to the package's
516+
__path__. This is useful if one wants to distribute different
517+
parts of a single logical package as multiple directories.
518518
519519
It also looks for *.pkg files beginning where * matches the name
520520
argument. This feature is similar to *.pth files (see site.py),

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.