diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-04-10 23:16:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-10 23:16:34 -0700 |
commit | 59fd08c25ccd3dcdd18682494e8bd1245565c46a (patch) | |
tree | df7a30daa8c102eb3b7bba7752f62efa453edf1a /Doc | |
parent | d9b25a2627ff6f4e10d46b4de4fff941b63497c7 (diff) | |
download | cpython-git-59fd08c25ccd3dcdd18682494e8bd1245565c46a.tar.gz |
better __init__.py explanation in tutorial (GH-12763)
* better __init__.py explanation in tutorial
* Update Doc/tutorial/modules.rst
Co-Authored-By: methane <songofacandy@gmail.com>
(cherry picked from commit 5410d3d283b11e2375f0c1f79728a230edd12bd0)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/tutorial/modules.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/tutorial/modules.rst b/Doc/tutorial/modules.rst index accc30649f..fd594fd97a 100644 --- a/Doc/tutorial/modules.rst +++ b/Doc/tutorial/modules.rst @@ -425,9 +425,9 @@ your package (expressed in terms of a hierarchical filesystem): When importing the package, Python searches through the directories on ``sys.path`` looking for the package subdirectory. -The :file:`__init__.py` files are required to make Python treat the directories -as containing packages; this is done to prevent directories with a common name, -such as ``string``, from unintentionally hiding valid modules that occur later +The :file:`__init__.py` files are required to make Python treat directories +containing the file as packages. This prevents directories with a common name, +such as ``string``, unintentionally hiding valid modules that occur later on the module search path. In the simplest case, :file:`__init__.py` can just be an empty file, but it can also execute initialization code for the package or set the ``__all__`` variable, described later. |