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-38994: Implement __class_getitem__ for PathLike #17498

Merged
merged 2 commits into from Dec 8, 2019

Conversation

isidentical
Copy link
Sponsor Member

@isidentical isidentical commented Dec 7, 2019

Copy link
Contributor

@asvetlov asvetlov left a comment

Adding __class_getitem__ to os.PathLike only is not enough for using, e.g. pathlib.Path[str] in runtime.

pathlib.PurePath should be modified in this way as well.

@bedevere-bot
Copy link

bedevere-bot commented Dec 8, 2019

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.

@isidentical
Copy link
Sponsor Member Author

isidentical commented Dec 8, 2019

@asvetlov I have made the requested changes; please review again

@bedevere-bot
Copy link

bedevere-bot commented Dec 8, 2019

Thanks for making the requested changes!

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

@bedevere-bot bedevere-bot requested a review from asvetlov Dec 8, 2019
@asvetlov asvetlov added the 🤖 automerge PR will be merged once it's been approved and all CI passed label Dec 8, 2019
@miss-islington miss-islington merged commit 526606b into python:master Dec 8, 2019
@asvetlov
Copy link
Contributor

asvetlov commented Dec 8, 2019

Awesome, thanks!

@@ -0,0 +1 @@
Implement ``__class_getitem__`` for ``os.PathLike``, ``pathlib.Path``
Copy link
Member

@brettcannon brettcannon Dec 9, 2019

Choose a reason for hiding this comment

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

This news item is slightly misleading as the change was made to pathlib.PurePath, not pathlib.Path.

Copy link
Member

@brettcannon brettcannon Dec 9, 2019

Choose a reason for hiding this comment

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

And @isidentical forgot to give himself credit for the change. :)

@brettcannon
Copy link
Member

brettcannon commented Dec 9, 2019

Any reason not to document this?

@isidentical
Copy link
Sponsor Member Author

isidentical commented Dec 9, 2019

It is kind of irrelevant but I wrote a simple script to analyze typeshed and I think i found other classes with missing class getitems. Should I open an issue per class or just open one and fix all of them in one PR (I can tweak the comment change @brettcannon said in that PR). It is like 6-7 lines per class so i dont think it would make review harder.

@brettcannon
Copy link
Member

brettcannon commented Dec 10, 2019

@isidentical individual is always easier to review, but if it's too much work you can try doing it in a single PR.

@asvetlov
Copy link
Contributor

asvetlov commented Dec 10, 2019

@isidentical would you make a follow-up PR for fixing @brettcannon notes?

@isidentical
Copy link
Sponsor Member Author

isidentical commented Dec 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 automerge PR will be merged once it's been approved and all CI passed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants