Skip to content

Commit 1c52b55

Browse files
authored
Merge pull request #830 from elanorigby/master
Clarification for Module Naming
2 parents 0537fb4 + d39c485 commit 1c52b55

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

docs/starting/install3/win.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _install3-windows:
22

33
Installing Python 3 on Windows
4-
============================
4+
==============================
55

66
First, download the `latest version <https://www.python.org/ftp/python/3.6.0/python-3.6.0.exe>`_
77
of Python 3.6 from the official website. If you want to be sure you are installing a fully

docs/writing/structure.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,17 @@ folder named :file:`my` which is not the case. There is an
391391
dot notation should be used in the Python docs.
392392

393393
If you'd like you could name your module :file:`my_spam.py`, but even our
394-
friend the underscore should not be seen often in module names.
394+
friend the underscore should not be seen often in module names. However, using other
395+
characters (spaces or hyphens) in module names will prevent importing
396+
(- is the subtract operator), so try to keep module names short so there is
397+
no need to separate words. And, most of all, don't namespace with underscores, use submodules instead.
398+
399+
.. code-block:: python
400+
401+
# OK
402+
import library.plugin.foo
403+
# not OK
404+
import library.foo_plugin
395405
396406
Aside from some naming restrictions, nothing special is required for a Python
397407
file to be a module, but you need to understand the import mechanism in order

0 commit comments

Comments
 (0)