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

Prohibit issubclass() for runtime protocols with non-method members #3939

Closed
ilevkivskyi opened this issue Sep 9, 2017 · 0 comments
Closed

Comments

@ilevkivskyi
Copy link
Member

As discussed in python/typing#464, issubclass() with runtime protocols that declare non-method attributes is too ambiguous. Therefore it is proposed to prohibit such calls. Note that isinstance() is still fine.

@ilevkivskyi ilevkivskyi self-assigned this Sep 9, 2017
gvanrossum pushed a commit that referenced this issue Sep 29, 2017
This updates protocol semantic according to the discussion in python/typing#464:

    None should be considered a subtype of an empty protocol
    method = None rule should apply only to callable protocol members
    issublcass() is prohibited for protocols with non-method members.

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

No branches or pull requests

1 participant