Skip to content

Commit f86a595

Browse files
[3.14] Pedantic rewording of why relative importing doesn't work in main modules (GH-136846) (#136940)
Pedantic rewording of why relative importing doesn't work in main modules (GH-136846) Pedantically reword the section about relative imports and main modules. (cherry picked from commit 4b68289) Co-authored-by: Josh Cannon <joshdcannon@gmail.com>
1 parent 11378e1 commit f86a595

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)