Certain Piecewise expressions will recursively evaluate themselves ad 
infinitium for every call to .doit (), instead of recognizing the 
recursion. For example:

Sum (x**n, (n, -1, oo)).doit () 
= Piecewise((1/(x*(1 - x)), Abs(x) < 1), (Sum(x**n, (n, -1, oo)), True))

Piecewise((1/(x*(1 - x)), Abs(x) < 1), (Sum(x**n, (n, -1, oo)), True)).doit 
() 
= Piecewise((1/(x*(1 - x)), Abs(x) < 1), (Piecewise((1/(x*(1 - x)), Abs(x) 
< 1), (Sum(x**n, (n, -1, oo)), True)), True))

etc...

Is this intended behavior?

This would not be a problem and .doit () could be artificially restricted 
to one call but this seems to happen within SymPy itself, e.g.

Sum (x**(n-1), (n, 0, oo)).doit () 
= Piecewise((1/(1 - x), Abs(x) < 1), (Piecewise((1/(1 - x), Abs(x) < 1), 
(Sum(x**n, (n, 0, oo)), True)), True))/x

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/bb54a4aa-7634-46a4-bdce-fbee3bc1074e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to