The noncancellation is also about computational issues here.
Automatically performing a cancel when an object is created could be
potentially be very expensive. However, SymPy automatically cancels
terms. Actually, it just combines exponents, so x*x becomes x**2,
x/x**2 becomes 1/x and x/x becomes x**0 == 1 (these are all the same
because SymPy treats 1/x as x**-1). Of course, anything with a
nonpositive exponent does not make sense if x is 0.
Without knowing more of what you are doing, I can't give the best
advice, but I would suggest just keeping the numerator and denominator
separate.
Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
sympy+un...@googlegroups.com.
> To post to this group, send email to
sy...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/sympy.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/sympy/0b461aec-c962-407a-b886-48d7d464f4f8%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.