GeezerVison is showing github.com — bpo-36898: Add parameter @case_sensitive to glob and rglob in pathlib by monchin · Pull Request #13274 · python/cpython
Conversation
monchin
commented
May 13, 2019
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
In pathlib, I add a parameter case_sensitive to glob and rglob.
Sometimes the extension would be in upper case but sometimes it would be lower case, for example: *.tif and *.TIF. So the parameter case_sensitive may be useful in some cases.
Usage example:
In [1]: from pathlib import Path
In [2]: path = Path('.')
In [3]: for each_file in path.glob('*.tif'):
...: print(each_file)
...:
a.tif
b.tif
In [4]: for each_file in path.rglob('*.TIF'):
...: print(each_file)
...:
c.TIF
TEST/d.TIF
In [5]: for each_file in path.glob('*.TIF', case_sensitive=False):
...: print(each_file)
...:
a.tif
c.TIF
b.tif
In [6]: for each_file in path.rglob('*.TIF', case_sensitive=False):
...: print(each_file)
...:
a.tif
c.TIF
b.tif
TEST/d.TIF
TEST/e.tif
https://bugs.python.org/issue36898
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Hello, and thanks for your contribution!
I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).
Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.
You can check yourself to see if the CLA has been received.
Thanks again for your contribution, we look forward to reviewing it!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
monchin
changed the title
Add parameter @case_sensitive to glob and rglob in pathlib
bpo-36898: Add parameter @case_sensitive to glob and rglob in pathlib
May 13, 2019
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.
I think that this is a good improve.
You need to write tests and NEW file.
Don't forget sign the CLA :-)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks for the PR, but closing as the CLA has not been signed within the last month. If you do decide to sign the CLA we can re-open this PR.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
1 more reviewer
eamanu
eamanu requested changes
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.