gh-127541: Update os.walk example#127765
Conversation
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
picnixz
left a comment
There was a problem hiding this comment.
See my latest comment: https://github.com/python/cpython/pull/127765/files#r1876269560.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
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. |
|
Thank you! |
|
Hi @gpshead , just pinging in case this PR was missed. Appreciate any final review! |
gpshead
left a comment
There was a problem hiding this comment.
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 <116938397+totosuki@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
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 <116938397+totosuki@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
|
Update os.walk example to be more modern, skip `__pycache__` dirs rather than `CVS` dirs. (cherry picked from commit a594998) Co-authored-by: Totosuki <116938397+totosuki@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
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 <116938397+totosuki@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
I updated the example to exclude
__pycache__directories instead ofCVS.While the issue suggested replacing
CVSwith.git, a comment pointed out that.gitis 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/