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

Conversation

thejcannon
Copy link

@thejcannon thejcannon commented Jul 27, 2025

I'm a masochist, so here I go mucking around in the world of namespace packages. Really, I just wanted to link to a definition in an upcoming blog post, and realized there wasn't one.

The wording itself is mostly lifted directly from the first line of PEP 420. For the embellishments, I'm not the best wordsmith so happy to take suggestions.

(I was thinking we could include definitions for "explicit" or "implicit", but incremental improvement is still improvement)


📚 Documentation preview 📚: https://python-packaging-user-guide--1882.org.readthedocs.build/en/1882/

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.

@thejcannon
Copy link
Author

CC @jeanas and @qwcode as prior editors to the glossary for "Import Packages" and "Distribution Packages"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants