Dear group,

Recently Bruce Allen discussed a problem that he had after pickling a list. However, I think he revealed a deeper problem that is nothing to do with pickling.

w=sin(Symbol("x", positive=True))*cos(Symbol("x"))

       sin(x)*cos(x)

test=Integral(w,,x)

        Integral(sin(x)*cos(x), x)

test.doit()

        sin(x)*sin(x)

OK, that was a bit contrived, but it does show how worryingly easy it is to generate multiple symbols with the same name in the same Python context.

Clearly when processing the first statement, SymPy inserts x into its data base as a symbol with an assumption. After that it creates a distinct symbol x without that assumption!

I would have thought it would be kinder to cause an exception in that case to prevent the ensuing confusion.

David

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/e008170c-fc64-8101-3f03-9f988429c848%40dbailey.co.uk.

Reply via email to