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

All protocols and their explicit subclasses are ABCs #6042

Merged
merged 3 commits into from
Dec 10, 2018

Conversation

ilevkivskyi
Copy link
Member

Fixes #6036

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

LGTM, just one idea about a TODO item.

@@ -1339,6 +1339,13 @@ def analyze_metaclass(self, defn: ClassDef) -> None:
assert isinstance(inst, Instance)
defn.info.declared_metaclass = inst
defn.info.metaclass_type = defn.info.calculate_metaclass_type()
if any(info.is_protocol for info in defn.info.mro):
if (not defn.info.metaclass_type or
defn.info.metaclass_type.type.fullname() == 'builtins.type'):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe add a TODO about checking metaclass conflicts If there is another metaclass.

@ilevkivskyi ilevkivskyi merged commit 99d4c6b into python:master Dec 10, 2018
@ilevkivskyi ilevkivskyi deleted the all-proto-abc branch December 10, 2018 14:39
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

2 participants