[sympy] Re: sympy exception invalid input mod

2022-04-22 Thread Thomas Ligon
I've done some more testing. It looks like some simplification of the expression is not happening, but I haven't been able to understand when and why it is done or not done. Here is a test program created by copying the expression values from the debugger into the test program. Everything works

[sympy] Re: sympy exception invalid input mod

2022-04-20 Thread Thomas Ligon
Yes, that is exactly what I thought, and that there might be some kind of unintended side effect that I don't see. Here is another example I just got: print(exp) #!! exp = expand(exp) print(exp) #!! exp = factor(exp) produces: (-1*(-2)*(m_0**2 + 2*(-2)*m_0 - 2*(-2)*m_0 + (-2)**2 -

[sympy] Re: sympy exception invalid input mod

2022-04-20 Thread Chris Smith
> I can't see why something that should work the same every time suddenly fails with an exception Since you don't pass variables to the function, it's return value will depend on the value of those variables in the calling context ``` def f(): return i >>> for i in range(2): f() ... 0 1