class Rational(Expression, Fraction):
def __new__(cls, numerator=0, denominator=None):
- self = Fraction.__new__(cls, numerator, denominator)
+ self = object().__new__(cls)
self._coefficients = {}
- self._constant = Fraction(self)
+ self._constant = Fraction(numerator, denominator)
self._symbols = ()
self._dimension = 0
+ self._numerator = self._constant.numerator
+ self._denominator = self._constant.denominator
return self
def __hash__(self):