Skip to content

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

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

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

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

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

Copy link
Contributor

@eamanu eamanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@thejcannon
Copy link
Contributor Author

CLA has been signed 😃

@JulienPalard
Copy link
Member

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bedevere-bot
Copy link

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.

@thejcannon
Copy link
Contributor Author

@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

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

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

@pganssle
Copy link
Member

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!

@thejcannon
Copy link
Contributor Author

thejcannon commented Nov 20, 2020

@pganssle Happy to help ❤️

@thejcannon thejcannon deleted the fix-issue-35498 branch November 20, 2020 16:18
@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.

9 participants