Skip to content

Commit 0335a1f

Browse files
authored
Add importlib pointer
1 parent bbbab1a commit 0335a1f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

source/discussions/distribution-package-vs-import-package.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ How do distribution package names and import package names compare?
8282

8383
Import packages should have valid Python identifiers as their name (the
8484
:ref:`exact rules <python:identifiers>` are found in the Python
85-
documentation). In particular, they use underscores ``_`` as word
85+
documentation) #[non-identifier-mod-name]_. In particular, they use underscores ``_`` as word
8686
separator and they are case-sensitive.
8787

8888
On the other hand, distribution packages can use hyphens ``-`` or
@@ -95,6 +95,16 @@ precise rules are given in the :ref:`name normalization specification
9595
<name-normalization>`).
9696

9797

98+
99+
-
100+
---------------------------
101+
102+
.. [#non-identifier-mod-name] Although is technically possible
103+
to import packages/modules that do not have a valid Python identifier as
104+
their name, using :doc:`importlib <python:library/importlib>`,
105+
this is vanishingly rare and strongly discouraged.
106+
107+
98108
.. _distro: https://en.wikipedia.org/wiki/Linux_distribution
99109
.. _PyPI: https://pypi.org
100110
.. _Pillow: https://pypi.org/project/Pillow

0 commit comments

Comments
 (0)