units: remove duplicate method

This commit is contained in:
Sebastien Bourdeauducq 2014-06-10 15:16:45 +02:00
parent 7eb9641905
commit 8cc9c9eed6
1 changed files with 0 additions and 6 deletions

View File

@ -21,12 +21,6 @@ class Quantity:
r_prefix += 1 r_prefix += 1
return str(r_amount) + " " + _prefixes_str[r_prefix] + self.unit.name return str(r_amount) + " " + _prefixes_str[r_prefix] + self.unit.name
def __add__(self, other):
if self.unit != other.unit:
raise DimensionError
return Quantity(self.amount + other.amount, self.unit)
__radd__ = __add__
def __rmul__(self, other): def __rmul__(self, other):
if isinstance(other, Quantity): if isinstance(other, Quantity):
return NotImplemented return NotImplemented