mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
[3.13] Pedantic rewording of why relative importing doesn't work in main modules (GH-136846) (#136941)
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 4b68289ca6)
Co-authored-by: Josh Cannon <joshdcannon@gmail.com>
This commit is contained in:
parent
c1085a0a93
commit
de1c5e4f56
1 changed files with 2 additions and 2 deletions
|
|
@ -579,8 +579,8 @@ module for example, you might use::
|
|||
from .. import formats
|
||||
from ..filters import equalizer
|
||||
|
||||
Note that relative imports are based on the name of the current module. Since
|
||||
the name of the main module is always ``"__main__"``, modules intended for use
|
||||
Note that relative imports are based on the name of the current module's package.
|
||||
Since the main module does not have a package, modules intended for use
|
||||
as the main module of a Python application must always use absolute imports.
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue