]> CRI, Mines Paris - PSL - linpy.git/blobdiff - pypol/linear.py
Fix Expression.__rsub__
[linpy.git] / pypol / linear.py
index de6f4ca1d71b047fb76981c045b3fc7c6d8fe83e..c169049b2d42d3bba4c80cfdba9d72afdc6a7eea 100644 (file)
@@ -158,7 +158,8 @@ class Expression:
         constant = self.constant - other.constant
         return Expression(coefficients, constant)
 
-    __rsub__ = __sub__
+    def __rsub__(self, other):
+        return -(self - other)
 
     @_polymorphic_method
     def __mul__(self, other):