mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 13:30:49 -05:00
## Summary As-is, the following rejects `return self.value` in `def other` in the subclass ([link](https://play.ty.dev/f55b47b2-313e-45d1-ba45-fde410bed32e)) because `self.value` is resolving to `Unknown | int | float | property`: ```python class Base: _value: float = 0.0 @property def value(self) -> float: return self._value @value.setter def value(self, v: float) -> None: self._value = v @property def other(self) -> float: return self.value @other.setter def other(self, v: float) -> None: self.value = v class Derived(Base): @property def other(self) -> float: return self.value @other.setter def other(self, v: float) -> None: reveal_type(self.value) # revealed: int | float self.value = v ``` I believe the root cause is that we're not excluding properties when searching for class methods, so we're treating the `other` setter as a classmethod. I don't fully understand how that ends up materializing as `| property` on the union though.