Skip to content

Commit d71fcde

Browse files
gh-113208: Mention namespace packages don't require __init__.py (#113209)
Co-authored-by: C.A.M. Gerlach <[email protected]>
1 parent 4658464 commit d71fcde

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/tutorial/modules.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,8 @@ When importing the package, Python searches through the directories on
437437
``sys.path`` looking for the package subdirectory.
438438

439439
The :file:`__init__.py` files are required to make Python treat directories
440-
containing the file as packages. This prevents directories with a common name,
440+
containing the file as packages (unless using a :term:`namespace package`, a
441+
relatively advanced feature). This prevents directories with a common name,
441442
such as ``string``, from unintentionally hiding valid modules that occur later
442443
on the module search path. In the simplest case, :file:`__init__.py` can just be
443444
an empty file, but it can also execute initialization code for the package or

0 commit comments

Comments
 (0)