https://github.com/python/cpython/commit/f86a59549b4b819d1eb825e5b87c9230d8b5822b
commit: f86a59549b4b819d1eb825e5b87c9230d8b5822b
branch: 3.14
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: gpshead <68491+gpsh...@users.noreply.github.com>
date: 2025-07-21T09:58:27-07:00
summary:

[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 4b68289ca6954b8d135e2ee2344e67fae38239fd)

Co-authored-by: Josh Cannon <joshdcan...@gmail.com>

files:
M Doc/tutorial/modules.rst

diff --git a/Doc/tutorial/modules.rst b/Doc/tutorial/modules.rst
index 47bf7547b4ae1d..f8105cd5441fec 100644
--- a/Doc/tutorial/modules.rst
+++ b/Doc/tutorial/modules.rst
@@ -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.
 
 

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: arch...@mail-archive.com

Reply via email to