Issue 2425 in sympy: Pretty printing bug

2011-05-25 Thread sympy
Status: Accepted Owner: asmeurer Labels: Type-Defect Priority-Critical Printing Milestone-Release0.7.0 New issue 2425 by asmeurer: Pretty printing bug http://code.google.com/p/sympy/issues/detail?id=2425 Ever since the commit commit b8d6252ea115032f7da8c46aca60af0b6a75fd36 Author: Ronan Lamy D

Re: Issue 2425 in sympy: Pretty printing bug

2011-05-25 Thread sympy
Updates: Cc: smi...@gmail.com Comment #1 on issue 2425 by asmeurer: Pretty printing bug http://code.google.com/p/sympy/issues/detail?id=2425 It boils down to this. In line 618 of pretty.py, if term.as_coeff_mul()[0] is negative, then the pretty printer expects (-term).as_coeff_mul()[0

Re: Issue 2425 in sympy: Pretty printing bug

2011-05-25 Thread sympy
Comment #2 on issue 2425 by asmeurer: Pretty printing bug http://code.google.com/p/sympy/issues/detail?id=2425 By the way, making as_coeff_mul() satisfy that invariant ((-term).as_coeff_mul()[0] == -(term).as_coeff_mul()[0]) might be a good idea, but the question is how difficult would it be

Re: Issue 2425 in sympy: Pretty printing bug

2011-05-25 Thread sympy
Comment #3 on issue 2425 by asmeurer: Pretty printing bug http://code.google.com/p/sympy/issues/detail?id=2425 It boils down (again) to this behavior: In [21]: a.args[0] Out[21]: x - 5 In [22]: a.args[0].as_coeff_mul() Out[22]: (-1, (-x + 5,)) Is this necessary? It leads to the kind of minus

Re: Issue 2425 in sympy: Pretty printing bug

2011-05-25 Thread sympy
Comment #4 on issue 2425 by matt...@gmail.com: Pretty printing bug http://code.google.com/p/sympy/issues/detail?id=2425 It seems we will soon converge here to the discussion about as_coeff_{mul, Mul} and why such low-level functions shouldn't do expensive (relatively) and arbitrary symbolic

Re: Issue 2425 in sympy: Pretty printing bug

2011-05-25 Thread sympy
Updates: Status: Started Comment #5 on issue 2425 by asmeurer: Pretty printing bug http://code.google.com/p/sympy/issues/detail?id=2425 Amazingly, if you remove Add.as_coeff_mul() (so that it always just returns (S.One, self)), there is only one test failure other than a test testing

Re: Issue 2425 in sympy: Pretty printing bug

2011-05-25 Thread sympy
Updates: Labels: NeedsReview asmeurer Comment #6 on issue 2425 by asmeurer: Pretty printing bug http://code.google.com/p/sympy/issues/detail?id=2425 It comes from (oo**(2 - x)).as_base_exp() returning (0, x - 2). This is because it checks if the base is Rational and flips it if it is

Re: Issue 2425 in sympy: Pretty printing bug

2011-05-26 Thread sympy
Updates: Status: Fixed Comment #7 on issue 2425 by smi...@gmail.com: Pretty printing bug http://code.google.com/p/sympy/issues/detail?id=2425 thanks, it's in. -- You received this message because you are subscribed to the Google Groups "sympy-issues" group. To post to this group, send