Skip to content

All protocols and their explicit subclasses are ABCs - #6042

Merged
ilevkivskyi merged 3 commits into
python:masterfrom
ilevkivskyi:all-proto-abc
Dec 10, 2018
Merged

ilevkivskyi merged 3 commits into
python:masterfrom
ilevkivskyi:all-proto-abc

Conversation

@ilevkivskyi

Copy link
Copy Markdown
Member

Fixes #6036

@JukkaL JukkaL left a comment

Copy link
Copy Markdown
Collaborator

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.

Comment thread mypy/semanal.py
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
Copy Markdown
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.

2 participants