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
{{ message }}
Repository navigation
collections.abc.Sequence considered typing.Sequence #6036
I wonder if this is due to a change in typeshed -- I get the same error with mypy at v0.641 but typeshed at the current rev, and I don't get the error with mypy at v0.650 but typeshed at the rev it was at in the mypy 0.641 release. (I hope you follow what I'm saying here.)
If you want to help fix this, it should be easy enough to track down the precise typeshed change using git bisect.
This is caused by PR python/typeshed#2658, for some reasons Sized was the only base that has metaclass=ABCMeta, and now it's gone. A quick solution is to put the metaclass back where it belongs.
However, I think a better solution is automatically infer ABCMeta as a metaclass for protocols if no explicit metaclass is given in a class or its bases. The reason is that Protocol is an instance of ABCMeta at runtime, plus logically protocols are just fancier ABCs that type-checkers understand statically.
Activity
Pin to the previous release of mypy
gvanrossum commentedon Dec 9, 2018
I wonder if this is due to a change in typeshed -- I get the same error with mypy at v0.641 but typeshed at the current rev, and I don't get the error with mypy at v0.650 but typeshed at the rev it was at in the mypy 0.641 release. (I hope you follow what I'm saying here.)
If you want to help fix this, it should be easy enough to track down the precise typeshed change using
git bisect.ilevkivskyi commentedon Dec 9, 2018
This is caused by PR python/typeshed#2658, for some reasons
Sizedwas the only base that hasmetaclass=ABCMeta, and now it's gone. A quick solution is to put the metaclass back where it belongs.However, I think a better solution is automatically infer
ABCMetaas a metaclass for protocols if no explicit metaclass is given in a class or its bases. The reason is thatProtocolis an instance ofABCMetaat runtime, plus logically protocols are just fancier ABCs that type-checkers understand statically.ilevkivskyi commentedon Dec 9, 2018
(set priority high, since this is a regression)
All protocols and their explicit subclasses are ABCs (#6042)