Closed
Description
Example:
from typing import *
TypeT = TypeVar("TypeT", bound=type)
class Base:
field: str = "Hey"
class C1:
def method(self, other: type) -> str:
if issubclass(other, Base):
# reveal_type(other) == Type[Base]
return other.field
return "Hi"
class C2(Generic[TypeT]):
def method(self, other: TypeT) -> str:
if issubclass(other, Base):
# reveal_type(other) == TypeT`1
return other.field # mypy error: "TypeT" has no attribute "field"
return "Hi"
Actual behavior as of 0.740 included in the comments above. Expected behavior would be to not raise an error on the penultimate line.