File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ How do distribution package names and import package names compare?
82
82
83
83
Import packages should have valid Python identifiers as their name (the
84
84
: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
86
86
separator and they are case-sensitive.
87
87
88
88
On the other hand, distribution packages can use hyphens ``- `` or
@@ -95,6 +95,16 @@ precise rules are given in the :ref:`name normalization specification
95
95
<name-normalization>`).
96
96
97
97
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
+
98
108
.. _distro : https://en.wikipedia.org/wiki/Linux_distribution
99
109
.. _PyPI : https://pypi.org
100
110
.. _Pillow : https://pypi.org/project/Pillow
You can’t perform that action at this time.
0 commit comments