Type error при работе со свойствами

class Person:
    def __init__(self, name, old):
        self.__name = name
        self.__old = old
    
    def get_old(self):
        return self.__old
    
    def set_old(self, old):
        self.__old = old
    
    old = property(get_old, set_old)
    
p = Person("John", 19)
p.old = 18
print(p.old())

PyCharm выдает две проблемы в 12 строке:

Expected type '(Any) -> Any | None', got '(self: Person) -> Any' instead

Expected type '(Any, Any) -> None | None', got '(self: Person, old: Any) -> None' instead

А также в консоли вижу такой Traceback:

Traceback (most recent call last):
  File "C:\Users\proba\PycharmProjects\PythonProject\oop.py", line 17, in <module>
    print(p.old())
TypeError: 'int' object is not callable

Ответы (0 шт):