Skip to content

Commit 4b68289

Browse files
authored
Pedantic rewording of why relative importing doesn't work in main modules (GH-136846)
Pedantically reword the section about relative imports and main modules.
1 parent 65893c6 commit 4b68289

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/tutorial/modules.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,8 @@ module for example, you might use::
579579
from .. import formats
580580
from ..filters import equalizer
581581

582-
Note that relative imports are based on the name of the current module. Since
583-
the name of the main module is always ``"__main__"``, modules intended for use
582+
Note that relative imports are based on the name of the current module's package.
583+
Since the main module does not have a package, modules intended for use
584584
as the main module of a Python application must always use absolute imports.
585585

586586

0 commit comments

Comments
 (0)