raise TypeError('In strict_mode only two moneys can be added')
else:
return Money(
- amount=self.amount + Decimal(float(other)), currency=self.currency
+ amount=self.amount + Decimal(float(other)),
+ currency=self.currency,
)
def __sub__(self, other):
raise TypeError('In strict_mode only two moneys can be added')
else:
return Money(
- amount=self.amount - Decimal(float(other)), currency=self.currency
+ amount=self.amount - Decimal(float(other)),
+ currency=self.currency,
)
def __mul__(self, other):
raise TypeError('can not multiply monetary quantities')
else:
return Money(
- amount=self.amount * Decimal(float(other)), currency=self.currency
+ amount=self.amount * Decimal(float(other)),
+ currency=self.currency,
)
def __truediv__(self, other):
raise TypeError('can not divide monetary quantities')
else:
return Money(
- amount=self.amount / Decimal(float(other)), currency=self.currency
+ amount=self.amount / Decimal(float(other)),
+ currency=self.currency,
)
def __float__(self):
raise TypeError('In strict_mode only two moneys can be added')
else:
return Money(
- amount=Decimal(float(other)) - self.amount, currency=self.currency
+ amount=Decimal(float(other)) - self.amount,
+ currency=self.currency,
)
__rmul__ = __mul__