diff --git a/examples/python/complex/complex.py b/examples/python/complex/complex.py index 3623b5f1e..aa9adeef8 100644 --- a/examples/python/complex/complex.py +++ b/examples/python/complex/complex.py @@ -46,7 +46,7 @@ class ComplexExpr: other = _to_complex(other) return ComplexExpr(self.r*other.r - self.i*other.i, self.r*other.i + self.i*other.r) - def __mul__(self, other): + def __rmul__(self, other): other = _to_complex(other) return ComplexExpr(other.r*self.r - other.i*self.i, other.i*self.r + other.r*self.i)