Skip to content
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

bpo-35498: Added slice support to PathLib parents attribute. #11165

Merged
merged 7 commits into from Nov 20, 2020

Conversation

thejcannon
Copy link
Contributor

@thejcannon thejcannon commented Dec 14, 2018

@the-knights-who-say-ni
Copy link

the-knights-who-say-ni commented Dec 14, 2018

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).

Our records indicate we have not received your CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

@terryjreedy
Copy link
Member

terryjreedy commented Dec 14, 2018

On the issue, Joshua wrote "CLA signage is pending approval at the company I work for, " .

eamanu
eamanu approved these changes Dec 17, 2018
Copy link
Contributor

@eamanu eamanu left a comment

LGTM.

Lib/pathlib.py Outdated Show resolved Hide resolved
@thejcannon
Copy link
Contributor Author

thejcannon commented Dec 28, 2018

CLA has been signed 😃

@JulienPalard
Copy link
Member

JulienPalard commented Sep 13, 2019

See the issue: I'm trying to understand in which case it could be usefull to slice parents, please comment on the issue.

Copy link
Member

@pganssle pganssle left a comment

I think that pathlib.Path.parents should support slices and negative indexing.

Assuming @pitrou doesn't object, I am thinking that we'll merge #21799 (since that's a much simpler PR), then this should be rebased onto that PR, and the .. versionchanged:: and What's New entries should be updated.

Lib/test/test_pathlib.py Outdated Show resolved Hide resolved
Lib/pathlib.py Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

bedevere-bot commented Nov 19, 2020

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. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Lib/pathlib.py Show resolved Hide resolved
@thejcannon
Copy link
Contributor Author

thejcannon commented Nov 19, 2020

@pganssle I went ahead and updated the What's New and pathlib documentation (I'll resolve any merge issues after #21799 is in, but I wanted to resolve the issues while this is fresh),

I'm excited to add "Contributed to Python" to my resume, even if my contribution is small 😄

@thejcannon
Copy link
Contributor Author

thejcannon commented Nov 19, 2020

I have made the requested changes; please review again

@bedevere-bot
Copy link

bedevere-bot commented Nov 19, 2020

Thanks for making the requested changes!

@pganssle: please review the changes made to this pull request.

@bedevere-bot bedevere-bot requested a review from pganssle Nov 19, 2020
@pganssle
Copy link
Member

pganssle commented Nov 20, 2020

OK, since this one is ready first, I'll merge it and the other one can be rebased on top of master.

Thanks for your work on this @thejcannon, and thanks for the quick turnaround on post-review changes after your PR has been sitting idle for almost 2 years!

@pganssle pganssle merged commit 4520584 into python:master Nov 20, 2020
3 checks passed
@thejcannon
Copy link
Contributor Author

thejcannon commented Nov 20, 2020

@pganssle Happy to help ❤️

@thejcannon thejcannon deleted the fix-issue-35498 branch Nov 20, 2020
@hroncok
Copy link
Contributor

hroncok commented Nov 27, 2020

Thanks for this!

adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
…H-11165)

Added slice support to the `pathlib.Path.parents` sequence. For a `Path` `p`, slices of `p.parents` should return the same thing as slices of `tuple(p.parents)`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants