Bug Report
In mypy 1.16, the relative ordering of property methods (i.e., getter/setter/deleter) can produce an "Invalid property setter signature" error.
To Reproduce
mypy playground with the same example
Having an @deleter or @getter before a @setter property method produces an error:
classC:
_value: int=0@propertydefvalue(self) ->int:
returnself._value@value.deleterdefvalue(self) ->None: ... # error: Invalid property setter signature [misc]@value.setterdefvalue(self, v: int) ->None: ...
$ mypy t.py
main.py:9: error: Invalid property setter signature [misc]
Found 1 error in 1 file (checked 1 source file)
Move the @value.deleter method to after @value.setter and the error is fixed.
classC:
_value: int=0@propertydefvalue(self) ->int:
returnself._value@value.setterdefvalue(self, v: int) ->None: ...
@value.deleterdefvalue(self) ->None: ...
$ mypy t.py
Success: no issues found in 1 source file
Expected Behavior
The relative ordering should not alter the output of mypy. I'm not aware of any reason why the ordering should matter and all orderings pass mypy in 1.15.
Your Environment
- Mypy version used: 1.16
- Mypy command-line flags: None
- Mypy configuration options from
mypy.ini (and other config files): None - Python version used: 3.13
Bug Report
In mypy 1.16, the relative ordering of property methods (i.e.,
getter/setter/deleter) can produce an "Invalid property setter signature" error.To Reproduce
mypy playground with the same example
Having an
@deleteror@getterbefore a@setterproperty method produces an error:Move the
@value.deletermethod to after@value.setterand the error is fixed.Expected Behavior
The relative ordering should not alter the output of mypy. I'm not aware of any reason why the ordering should matter and all orderings pass mypy in 1.15.
Your Environment
mypy.ini(and other config files): None