From 474fc7ab96a53e71eb15db78b9d0e01aa2e1ecbc Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Tue, 29 Sep 2026 09:23:31 +0000 Subject: [PATCH] CoinAmt: remove unneeded variadic params in dunder methods --- mmgen/amt.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/mmgen/amt.py b/mmgen/amt.py index 6a120a25..91ea1ba6 100755 --- a/mmgen/amt.py +++ b/mmgen/amt.py @@ -125,53 +125,53 @@ class CoinAmt(Decimal, Hilite, InitErrors): # abstract class def __repr__(self): return "{}('{}')".format(type(self).__name__, self.__str__()) - def __add__(self, other, *args, **kwargs): + def __add__(self, other): """ we must allow other to be int(0) to use the sum() builtin """ if type(other) is type(self) or (other == 0 and isinstance(other, int)): - return type(self)(Decimal.__add__(self, other, *args, **kwargs), from_decimal=True) + return type(self)(Decimal.__add__(self, other), from_decimal=True) raise TypeError( f'operand {other} is of incorrect type ({type(other).__name__} != {type(self).__name__})') __radd__ = __add__ - def __sub__(self, other, *args, **kwargs): + def __sub__(self, other): if type(other) is type(self): - return type(self)(Decimal.__sub__(Decimal(self), Decimal(other), *args, **kwargs), from_decimal=True) + return type(self)(Decimal.__sub__(Decimal(self), Decimal(other)), from_decimal=True) raise TypeError( f'operand {other} is of incorrect type ({type(other).__name__} != {type(self).__name__})') - def __rsub__(self, other, *args, **kwargs): + def __rsub__(self, other): if type(other) is type(self): - return type(self)(Decimal.__rsub__(self, other, *args, **kwargs), from_decimal=True) + return type(self)(Decimal.__rsub__(self, other), from_decimal=True) raise TypeError( f'operand {other} is of incorrect type ({type(other).__name__} != {type(self).__name__})') - def __mul__(self, other, *args, **kwargs): + def __mul__(self, other): return type(self)('{:0.{p}f}'.format( - Decimal.__mul__(self, Decimal(other), *args, **kwargs), + Decimal.__mul__(self, Decimal(other)), p = self.max_prec)) __rmul__ = __mul__ - def __truediv__(self, other, *args, **kwargs): + def __truediv__(self, other): return type(self)('{:0.{p}f}'.format( - Decimal.__truediv__(self, Decimal(other), *args, **kwargs), + Decimal.__truediv__(self, Decimal(other)), p = self.max_prec)) - def __rtruediv__(self, other, *args, **kwargs): + def __rtruediv__(self, other): return type(self)('{:0.{p}f}'.format( - Decimal.__rtruediv__(self, Decimal(other), *args, **kwargs), + Decimal.__rtruediv__(self, Decimal(other)), p = self.max_prec)) - def __neg__(self, *args, **kwargs): + def __neg__(self): self.method_not_implemented() - def __floordiv__(self, *args, **kwargs): + def __floordiv__(self, other): self.method_not_implemented() - def __mod__(self, *args, **kwargs): + def __mod__(self, other): self.method_not_implemented() def is_coin_amt(proto, num, *, from_unit=None, from_decimal=False):