Bug Report
from typing import reveal_type
class X:
y: int
def __eq__(self, other: object) -> bool:
return type(other) is reveal_type(type(self)) and other.y == self.y
This works as you would expect - no errors.
But make a small change and
from typing import reveal_type
class X:
y: int
def __eq__(self, other: object) -> bool:
return type(other) is type(self) and other.y == self.y
error: "object" has no attribute "y"