From f5c64ce9e414651b5d2fe538401452cbf5e86f6d Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand Date: Wed, 9 Mar 2016 10:49:29 +0300 Subject: [PATCH] New init for fraction --- pymath/calculus/fraction.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pymath/calculus/fraction.py b/pymath/calculus/fraction.py index a40ef46..07727b9 100644 --- a/pymath/calculus/fraction.py +++ b/pymath/calculus/fraction.py @@ -22,13 +22,14 @@ class Fraction(Explicable): :param denom: the denominator """ - super(Fraction, self).__init__() self._num = num if denom == 0: raise ZeroDivisionError("Can't create Fraction: division by zero") self._denom = denom self.isNumber = 1 + pstf_tokens = self.compute_postfix_tokens() + super(Fraction, self).__init__(pstf_tokens) def simplify(self): """Simplify the fraction @@ -87,8 +88,7 @@ class Fraction(Explicable): else: return copy(self) - @property - def postfix_tokens(self): + def compute_postfix_tokens(self): """Postfix form of the fraction >>> f = Fraction(3, 5)