Skip to content

Add "namespace package" to glossary #1882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions source/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ Glossary
types: :term:`Pure Module`, or :term:`Extension Module`.


Namespace Package

A mechanism for splitting a single :term:`Import Package <Import Package>`
across multiple directories on disk. Can either be "explicit" or "implicit",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
across multiple directories on disk. Can either be "explicit" or "implicit",
across multiple directories on disk. Can either be "explicit" or "implicit",

I guess this does not cover the (nowadays most common?) case where the package is all in one place on disk (i.e. in site-packages) but was installed from different distribution packages (i.e. from different packages/libraries on PyPI for example).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the PR description to include (because I forgot to mention) most of this is just lifted straight from the opening line of PEP 420:

Namespace packages are a mechanism for splitting a single Python package across multiple directories on disk.

That being said, what do you think about this change:

Suggested change
across multiple directories on disk. Can either be "explicit" or "implicit",
across one or more directories on disk. Can either be "explicit" or "implicit",

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I just found this so "disk" is incorrect.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aye, it's import locations rather than specifically directories on disk. The language reference definition covers implicit namespace packages, while the pkgutil.extend_path docs cover explicit namespace packages.

Having a glossary entry here that links to both of those reference definitions (as well as summarising them) is a good suggestion.

depending on the mechanism. Defined in :pep:`420`.


Package Index

A repository of distributions with a web interface to automate
Expand Down