gh-71261: Add paragraph on shadowing submodules with star imports#107004
Merged
hugovk merged 2 commits intopython:mainfrom Jul 23, 2023
Merged
gh-71261: Add paragraph on shadowing submodules with star imports#107004hugovk merged 2 commits intopython:mainfrom
hugovk merged 2 commits intopython:mainfrom
Conversation
evildmp
suggested changes
Jul 22, 2023
Doc/tutorial/modules.rst
Outdated
| ] | ||
|
|
||
| def reverse(msg: str): # <-- this name shadows the 'reverse.py' submodule | ||
| return msg[::-1] # in case of an 'from sound.effects import *' |
Contributor
There was a problem hiding this comment.
I suggest: "in the case of a ..."
evildmp
approved these changes
Jul 22, 2023
Contributor
Contributor
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jul 23, 2023
…ts (pythonGH-107004) (cherry picked from commit 680f3e1) Co-authored-by: wulmer <wulmer@users.noreply.github.com>
|
GH-107099 is a backport of this pull request to the 3.11 branch. |
|
GH-107100 is a backport of this pull request to the 3.12 branch. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jul 23, 2023
…ts (pythonGH-107004) (cherry picked from commit 680f3e1) Co-authored-by: wulmer <wulmer@users.noreply.github.com>
hugovk
pushed a commit
that referenced
this pull request
Jul 23, 2023
hugovk
pushed a commit
that referenced
this pull request
Jul 23, 2023
jtcave
pushed a commit
to jtcave/cpython
that referenced
this pull request
Jul 23, 2023
mementum
pushed a commit
to mementum/cpython
that referenced
this pull request
Jul 23, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR extends the tutorial on modules and packages by adding a paragraph on the
from abc import *problem in case of duplicate names for submodules and locally defined objects (e.g. functions).It intends to solve #71261 by providing an example of how a locally defined function breaks the import of submodules.
📚 Documentation preview 📚: https://cpython-previews--107004.org.readthedocs.build/