gh-141924:Splitting of Unrelated mixed ideas in one paragraph of the tutorial (sys.path section)#141935
Open
SkvProgrammer wants to merge 3 commits intopython:mainfrom
Open
gh-141924:Splitting of Unrelated mixed ideas in one paragraph of the tutorial (sys.path section)#141935SkvProgrammer wants to merge 3 commits intopython:mainfrom
SkvProgrammer wants to merge 3 commits intopython:mainfrom
Conversation
Doc/tutorial/modules.rst
Outdated
Comment on lines
208
to
217
| After initialization, Python programs may modify :data:sys.path directly. This | ||
| can be useful in some situations, but it may also lead to import-related issues | ||
| if misused. | ||
|
|
||
| Independently of any manual changes, Python automatically places the directory | ||
| containing the executed script at the beginning of the module search path. | ||
| Because this entry precedes the standard library path, modules in the script | ||
| directory can shadow standard library modules of the same name. This is usually | ||
| unintended and can lead to confusing errors. See section :ref:tut-standardmodules | ||
| for more information. |
Member
There was a problem hiding this comment.
Please dedent the text.
Contributor
Author
|
@StanFromIreland please review the changes |
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.
Splitting of Unrelated mixed ideas in one paragraph of the tutorial (sys.path section)
What's the problem
The first sentence describes the fact that Python programs can modify sys.path manually after initialization. The following sentences describe a separate and independent behavior: the directory of the executed script is automatically placed at the beginning of the module search path, which may cause shadowing of library modules with the same name.
These two behaviors are not logically connected yet are presented within a single paragraph without any transition. This may lead readers to incorrectly assume a relationship between manual modification of sys.path and the automatic placement of the script directory.
Improvement
Spliting the paragraph into two separate paragraphs, indicating that these are independent aspects of module lookup behavior. This will improve clarity and reduce potential confusion for readers.
from:
to:
sys.pathsection) #141924📚 Documentation preview 📚: https://cpython-previews--141935.org.readthedocs.build/