Skip to content

bpo-39019: Implement missing __class_getitem__ for os.DirEntry #17561

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

Closed
wants to merge 2 commits into from

Conversation

isidentical
Copy link
Member

@isidentical isidentical commented Dec 10, 2019

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

Thanks! Couple comments also here.

@@ -12808,6 +12815,7 @@ static PyMethodDef DirEntry_methods[] = {
OS_DIRENTRY_STAT_METHODDEF
OS_DIRENTRY_INODE_METHODDEF
OS_DIRENTRY___FSPATH___METHODDEF
{"__class_getitem__", DirEntry_cls_getitem, METH_O|METH_CLASS, NULL},
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to use Argument Clinic for this (to be consistent with the rest of the code in this module)?

Copy link
Member Author

Choose a reason for hiding this comment

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

I dont know if it possible, contextlib also uses argument clinic but they seperated __class_getitem. I thought there is a catch about this but I can try to do this with argument clinic.

@isidentical
Copy link
Member Author

Closing since pep 585 accepted

@isidentical isidentical closed this Apr 6, 2020
@gvanrossum
Copy link
Member

Hm, os.DirEntry[str] still gives an error. Maybe it still needs a __class_getitem__ method?

@isidentical
Copy link
Member Author

I was going to send a new PR but couldnt see it on PEP 585

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants