Bug Report
Since 2.4.0, errors in the body of a property getter are no longer reported when the property's setter assigns an attribute on self. Same result when the attribute is declared in the class body (e.g. x = 0).
To Reproduce
class A: @property def p(self) -> str: return 0 @p.setter def p(self, value: int) -> None: self.x = value
Expected Behavior
As with mypy 2.3.0:
main.py:4: error: Incompatible return value type (got "int", expected "str") [return-value] Found 1 error in 1 file (checked 1 source file)
See playground
Actual Behavior
Success: no issues found in 1 source file
Your Environment
There is a chance this is caused by the two-phase type-checking. I will take a look.
Process overloads as a whole in two-phase type-checking (python#22231)
that was quick, thanks !
Activity
ilevkivskyi commented on Oct 19, 2026
There is a chance this is caused by the two-phase type-checking. I will take a look.
Process overloads as a whole in two-phase type-checking (python#22231)
UnknownPlatypus commented on Oct 20, 2026
that was quick, thanks !