def main(): print "My application starts..." a = 2 b = 3 x = True y = False print add(a, b) print mul(a, b) print and_(x, y) print or_(x, y)
def __rdiv__(self, X): "Y.__rdiv__(X) <==> X/Y" return mul(X, self**-1)
def __div__(self, X): "Y.__div__(X) <==> Y/X" return mul(self, X**-1)
def __rmul__(self, X): "Y.__rmul__(X) <==> Y*X" return mul(X, self)
def __mul__(self, X): "Y.__mul__(X) <==> X*Y" return mul(self, X)
def test_mul(self): self.assertEquals(operators.mul(2,3), 6)
def test_mul(self): a = 2 b = 3 self.assertEquals(operators.mul(a, b), 7)
def __rmul__(self, data): return op.mul(data, self)
def __mul__(self, data): return op.mul(self, data)
def __neg__(self): return op.mul(self, -1)