Pedantic rewording of why relative importing doesn't work in main modules (GH-136846)

Pedantically reword the section about relative imports and main modules.
This commit is contained in:
Josh Cannon 2025-07-21 11:30:17 -05:00 committed by GitHub
parent 65893c6f9c
commit 4b68289ca6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.