From 8e6bb807db4365debc6d2bada91298887f10e0bc Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 24 Dec 2025 02:09:19 -0800 Subject: [PATCH 1/6] Clarify definition of native and implicit namespace packages --- source/guides/packaging-namespace-packages.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/guides/packaging-namespace-packages.rst b/source/guides/packaging-namespace-packages.rst index 3d929d527..86568e925 100644 --- a/source/guides/packaging-namespace-packages.rst +++ b/source/guides/packaging-namespace-packages.rst @@ -74,7 +74,9 @@ from which the latter is discouraged: Native namespace packages ------------------------- -Python 3.3 added **implicit** namespace packages from :pep:`420`. All that is +Python 3.3 added **implicit** namespace packages from :pep:`420`. +:term:`Native namespace` and :term:`implicit namespace` packages are two +names for the same thing. All that is required to create a native namespace package is that you just omit :file:`__init__.py` from the namespace package directory. An example file structure (following :ref:`src-layout `): From ef4f27d9cbd45eda94dbfdfe5a22dd289cd6ec4e Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 24 Dec 2025 02:27:34 -0800 Subject: [PATCH 2/6] Expand glossary with namespace package definitions Add explanation for implicit and native namespace packages. --- source/glossary.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/glossary.rst b/source/glossary.rst index 40c041f4c..be39c197f 100644 --- a/source/glossary.rst +++ b/source/glossary.rst @@ -119,6 +119,16 @@ Glossary extensions. + Implicit Namespace Package + Native Namespace Package + + Native namespace and implicit namespace packages are two names for the same thing. + The term "native" derives from the built-in feature of Python to create packages + without installing an extra package, such as setuptools, from outside the standard + library. The term "implicit" derives from the fact that you don't have to explicitly + declare the namespace package in a :file:`__init__.py` file. This guide uses these + names interchangeably. + Import Package A Python module which can contain other modules or recursively, other From 5b499454afbbacae52764a5d896a885911515d1a Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 24 Dec 2025 02:29:07 -0800 Subject: [PATCH 3/6] Add a note regarding namespace packages Clarify terminology regarding native and implicit namespace packages and link to glossary terms. --- source/guides/packaging-namespace-packages.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/guides/packaging-namespace-packages.rst b/source/guides/packaging-namespace-packages.rst index 86568e925..e0c69a124 100644 --- a/source/guides/packaging-namespace-packages.rst +++ b/source/guides/packaging-namespace-packages.rst @@ -71,12 +71,16 @@ from which the latter is discouraged: #. Use `legacy namespace packages`_. This comprises `pkgutil-style namespace packages`_ and `pkg_resources-style namespace packages`_. +.. note:: + + :term:`Native namespace ` and + :term:`implicit namespace ` packages are two + names for the same thing. This guide uses these names interchangeably. + Native namespace packages ------------------------- -Python 3.3 added **implicit** namespace packages from :pep:`420`. -:term:`Native namespace` and :term:`implicit namespace` packages are two -names for the same thing. All that is +Python 3.3 added **implicit** namespace packages from :pep:`420`. All that is required to create a native namespace package is that you just omit :file:`__init__.py` from the namespace package directory. An example file structure (following :ref:`src-layout `): From c8d916f7b5b23e8a5822a857297ece066f90cbb7 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 24 Dec 2025 02:35:21 -0800 Subject: [PATCH 4/6] Update glossary entry for namespace packages with pep 420 reference --- source/glossary.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/glossary.rst b/source/glossary.rst index be39c197f..46216fa3b 100644 --- a/source/glossary.rst +++ b/source/glossary.rst @@ -122,12 +122,16 @@ Glossary Implicit Namespace Package Native Namespace Package - Native namespace and implicit namespace packages are two names for the same thing. + "Native namespace packages" and "implicit namespace packages" are two names for + the same type of namespace package. It's defined in :pep:`420`, and is available + in Python 3.3 and later. + The term "native" derives from the built-in feature of Python to create packages without installing an extra package, such as setuptools, from outside the standard library. The term "implicit" derives from the fact that you don't have to explicitly - declare the namespace package in a :file:`__init__.py` file. This guide uses these - names interchangeably. + declare the namespace package in a :file:`__init__.py` file. + + This guide uses these names interchangeably. Import Package From 4d0f8fbae213e1b44a5d0db5c72b20b00f560d5f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 24 Dec 2025 10:38:57 +0000 Subject: [PATCH 5/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- source/glossary.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/glossary.rst b/source/glossary.rst index 46216fa3b..21904308b 100644 --- a/source/glossary.rst +++ b/source/glossary.rst @@ -124,7 +124,7 @@ Glossary "Native namespace packages" and "implicit namespace packages" are two names for the same type of namespace package. It's defined in :pep:`420`, and is available - in Python 3.3 and later. + in Python 3.3 and later. The term "native" derives from the built-in feature of Python to create packages without installing an extra package, such as setuptools, from outside the standard From e461c7da61a91a783a3c03b7a9994157d045a8f9 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 24 Dec 2025 13:41:33 -0800 Subject: [PATCH 6/6] Replace tab with spaces. Beware the GitHub editor! Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- source/glossary.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/glossary.rst b/source/glossary.rst index 21904308b..b5a568420 100644 --- a/source/glossary.rst +++ b/source/glossary.rst @@ -131,7 +131,7 @@ Glossary library. The term "implicit" derives from the fact that you don't have to explicitly declare the namespace package in a :file:`__init__.py` file. - This guide uses these names interchangeably. + This guide uses these names interchangeably. Import Package