-
Notifications
You must be signed in to change notification settings - Fork 24
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
Make collections.abc.* generic #5
Conversation
Try running
|
The test failure was due to protocol runtime attribute compatibility checking. I disabled checking for @runtime_checkable
class Custom(collections.abc.Iterable, Protocol):
def close(self): ...
class B: # would now require an implementation of __class_getitem__
def __iter__(self):
return []
def close(self):
return 0 |
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.
You said that __class_getitem__
is inherited -- maybe you need fewer of them?
Yep! Done. |
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.
Awesome! You left a few blank lines, in, but I'll take them.
….1 (pythonGH-24289) RFC 8018 superseded RFC 8018. Automerge-Triggered-By: GH:tiran
... and add tests for them.
I also removed
__class_getitem__
fromcollections.UserDict
/collections.UserList
, since those inherit fromcollections.abc
types (which is a nice test inheritance works for these types)!'I didn't import
types.GenericAlias
in_collections_abc
since this seems to be on the hot path for startup, and I figured that would be bad.