some_order = Order(SELL, amount=123, price=74.3)
some_order.price = 80.1 #После того, как значение поля изменилось, изменения должны автоматически отправиться на сервер.
class Order:
def __init__(self, op, amount=0, price=0):
self.__op = op
self.__amount = amount
self.__price = price
@property
def price(self):
return self.__price
@price.setter
def price(self, value):
print("sending info to serverz")
self.__price = value
BUY = "buy"
SELL = "sell"
some_order = Order(SELL, amount=123, price=74.3)
some_order.price = 80.1