Also, you have a bare except! (and while your at it, I would put in a comment explaining that fractions is only available in Python 2.6+)
Aaron Meurer On Nov 25, 2010, at 6:26 PM, Ronan Lamy wrote: > Le jeudi 25 novembre 2010 à 08:57 -0800, smichr a écrit : >> Or should/could it be handled with a converter? I wondered when and >> how that would be used and tried in my github/smichr sympify_fractions >> branch to use it to solve this problem. Could you take a look, Ronan? >> >> h[1] >>> import fractions as f >> h[1] >>> sympify(f.Fraction(1, 2)) >> 1/2 >> > It looks good on the sympify() front, but why don't you just use > Rational(x.numerator, x.denominator)? > > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
