How can I make methods to apply += or -= or any other operators to change the private integer attribute of a class? I mean, setter decorator seems to just set the value like this:
@var.setter
def var(self, value):
self.__var = value
But if I'd need to have multiple methods in which I have to change this property by value and not change it completely? Like this:
class SomeClass:
def __init__(self, var):
self.__var = var
@property
def var():
return __var
def VarPlus(self, value):
self.__var += value
def varMinus(self, value):
self.__var -= value
It seems that I couldn't use a setter decorator hereabout, without it, I can't set new values to a private property