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)) # -> True
Mypy could support cases like this by special casing ABCMeta.register
calls. __subclasshook__
, __subclasscheck__
, and __instancecheck__
are more troublesome and could be left ignored.