Closed as not planned
Description
Bug Report
#12046 describes one false positive in this case. However, any time the mirrored attribute is referenced also raises a false positive attribute error. Short of ignoring every reference to the offending attribute, I don't see a workaround.
To Reproduce
from dataclasses import dataclass, InitVar
@dataclass
class Baz:
foo: InitVar[int]
@property # type: ignore
def foo(self) -> int:
return 0
print(Baz(0).foo)
Actual Behavior
error: "Baz" has no attribute "foo" [attr-defined]
Your Environment
- Mypy version used: 0.910
- Python version used: 3.9
- Operating system and version: Ubuntu 20.04