-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Description
class A(metaclass=abc.ABCMeta): pass
class B: pass
A.register(B)
a: A = B() # currently E: Incompatible types in assignment (expression has type "B", variable has type "A")
print(isinstance(a, A)) # -> TrueMypy could support cases like this by special casing ABCMeta.register calls. __subclasshook__, __subclasscheck__, and __instancecheck__ are more troublesome and could be left ignored.
maxfischer2781, alex, iddan, joernheissler, Dominik1123 and 19 more