Skip to content

Commit 5410d3d

Browse files
authored
better __init__.py explanation in tutorial (#12763)
* better __init__.py explanation in tutorial * Update Doc/tutorial/modules.rst Co-Authored-By: methane <[email protected]>
1 parent b5e2959 commit 5410d3d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/tutorial/modules.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,9 @@ your package (expressed in terms of a hierarchical filesystem):
425425
When importing the package, Python searches through the directories on
426426
``sys.path`` looking for the package subdirectory.
427427

428-
The :file:`__init__.py` files are required to make Python treat the directories
429-
as containing packages; this is done to prevent directories with a common name,
430-
such as ``string``, from unintentionally hiding valid modules that occur later
428+
The :file:`__init__.py` files are required to make Python treat directories
429+
containing the file as packages. This prevents directories with a common name,
430+
such as ``string``, unintentionally hiding valid modules that occur later
431431
on the module search path. In the simplest case, :file:`__init__.py` can just be
432432
an empty file, but it can also execute initialization code for the package or
433433
set the ``__all__`` variable, described later.

0 commit comments

Comments
 (0)