Steps to reproduce
- Install pylint 3.2.5 with astroid 3.2.3
- Set up a Python script with the following code:
class Point:
def __init__(self, x: float, y: float):
self._x = x
self._y = y
@property
def x(self) -> float:
return self._x
@x.setter
def x(self, x: float):
self._x = x
@property
def y(self) -> float:
return self._y
@y.setter
def y(self, y: float):
self._y = y
test = Point(1.2, 3.4)
value_neg = -test.x
- Run pylint
Current behavior
The following error is emitted: E1130: bad operand type for unary -: Point (invalid-unary-operand-type)
Expected behavior
pylint reports no errors
python -c "from astroid import __pkginfo__; print(__pkginfo__.version)" output
3.2.3