-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-127541: Update os.walk example #127765
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
Conversation
Co-authored-by: Bénédikt Tran <[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.
See my latest comment: https://github.com/python/cpython/pull/127765/files#r1876269560.
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.
This is a better example. But look also at the fwalk()
example and docstrings.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I have made the requested changes; please review again. |
Thanks for making the requested changes! @serhiy-storchaka: please review the changes made to this pull request. |
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.
Thank you! |
Hi @gpshead , just pinging in case this PR was missed. Appreciate any final review! |
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! and good practical idea to use __pycache__
for the example directory to skip.
Update os.walk example to be more modern, skip `__pycache__` dirs rather than `CVS` dirs. (cherry picked from commit a594998) Co-authored-by: Totosuki <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
GH-131869 is a backport of this pull request to the 3.13 branch. |
gh-127541: Update os.walk example (GH-127765) Update os.walk example to be more modern, skip `__pycache__` dirs rather than `CVS` dirs. (cherry picked from commit a594998) Co-authored-by: Totosuki <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
|
|
Update os.walk example to be more modern, skip `__pycache__` dirs rather than `CVS` dirs. (cherry picked from commit a594998) Co-authored-by: Totosuki <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
GH-131873 is a backport of this pull request to the 3.12 branch. |
gh-127541: Update os.walk example (GH-127765) Update os.walk example to be more modern, skip `__pycache__` dirs rather than `CVS` dirs. (cherry picked from commit a594998) Co-authored-by: Totosuki <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
Update os.walk example to be more modern, skip `__pycache__` dirs rather than `CVS` dirs. Co-authored-by: Bénédikt Tran <[email protected]>
I updated the example to exclude
__pycache__
directories instead ofCVS
.While the issue suggested replacing
CVS
with.git
, a comment pointed out that.git
is usually found only in the root directory, making it not equivalent toCVS
, which can appear in multiple subdirectories.On the other hand,
__pycache__
directories often appear across various levels of a directory tree, making them a more practical modern example!📚 Documentation preview 📚: https://cpython-previews--127765.org.readthedocs.build/