2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-24 19:04:02 +08:00

units: remove duplicate method

This commit is contained in:
Sebastien Bourdeauducq 2014-06-10 15:16:45 +02:00
parent 7eb9641905
commit 8cc9c9eed6

View File

@ -21,12 +21,6 @@ class Quantity:
r_prefix += 1
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):
if isinstance(other, Quantity):
return NotImplemented