forked from M-Labs/artiq
1
0
Fork 0

language/units: add mod

This commit is contained in:
Sebastien Bourdeauducq 2014-10-06 23:26:35 +08:00
parent 0985a53df2
commit 1a64e92e75
1 changed files with 6 additions and 0 deletions

View File

@ -131,6 +131,12 @@ class Quantity:
def __rsub__(self, other): def __rsub__(self, other):
return self._binop(other, "__rsub__", addsub_dimension) return self._binop(other, "__rsub__", addsub_dimension)
def __mod__(self, other):
return self._binop(other, "__mod__", addsub_dimension)
def __rmod__(self, other):
return self._binop(other, "__rmod__", addsub_dimension)
# comparisons # comparisons
def _cmp(self, other, opf_name): def _cmp(self, other, opf_name):
if isinstance(other, Quantity): if isinstance(other, Quantity):