You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently mypy applies the rule that things like __iter__ = None block protocol implementation. However, it is applied only to dunder attributes, which is too ad-hoc (also there are names like send and throw in collections.abc). It is proposed in python/typing#464 that it should be applied only to methods (callable members) which would be more consistent.
The text was updated successfully, but these errors were encountered:
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#3906Fixes#3938Fixes#3939
Currently mypy applies the rule that things like
__iter__ = None
block protocol implementation. However, it is applied only to dunder attributes, which is too ad-hoc (also there are names likesend
andthrow
incollections.abc
). It is proposed in python/typing#464 that it should be applied only to methods (callable members) which would be more consistent.The text was updated successfully, but these errors were encountered: