-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-113208: Mention namespace packages don't require __init__.py #113209
Conversation
@hugovk @CAM-Gerlach check this out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @Unique-Usman . I added one suggestion to fix a typo; apply it by clicking Commit Suggestion
, or together with others by going to the Files changed
tab, clicking Add suggestion to batch
for each suggestion, and then Commit
. Otherwise, LGTM as far as my input goes
Co-authored-by: C.A.M. Gerlach <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! @hugovk ?
Thanks! |
Thanks @Unique-Usman for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
GH-113276 is a backport of this pull request to the 3.12 branch. |
…pythonGH-113209) (cherry picked from commit d71fcde) Co-authored-by: Unique-Usman <[email protected]> Co-authored-by: C.A.M. Gerlach <[email protected]>
GH-113277 is a backport of this pull request to the 3.11 branch. |
…pythonGH-113209) (cherry picked from commit d71fcde) Co-authored-by: Unique-Usman <[email protected]> Co-authored-by: C.A.M. Gerlach <[email protected]>
GH-113209) (#113277) Co-authored-by: Unique-Usman <[email protected]> Co-authored-by: C.A.M. Gerlach <[email protected]>
GH-113209) (#113276) Co-authored-by: Unique-Usman <[email protected]> Co-authored-by: C.A.M. Gerlach <[email protected]>
…python#113209) Co-authored-by: C.A.M. Gerlach <[email protected]>
…python#113209) Co-authored-by: C.A.M. Gerlach <[email protected]>
…python#113209) Co-authored-by: C.A.M. Gerlach <[email protected]>
@@ -437,7 +437,8 @@ When importing the package, Python searches through the directories on | |||
``sys.path`` looking for the package subdirectory. | |||
|
|||
The :file:`__init__.py` files are required to make Python treat directories | |||
containing the file as packages. This prevents directories with a common name, | |||
containing the file as packages (unless using a :term:`namespace package`, a | |||
relatively advanced feature). This prevents directories with a common name, | |||
such as ``string``, from unintentionally hiding valid modules that occur later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So… this line is not true anymore 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @merwok, could you provide a reference to the updated way, I can open a pr for it.
__init__.py files are required to make Python treat directories containing the file as packages.
might be confusing #113208📚 Documentation preview 📚: https://cpython-previews--113209.org.readthedocs.build/