Comment #15 on issue 2587 by [email protected]: Strange printing at SymPy Live
http://code.google.com/p/sympy/issues/detail?id=2587

After further investigation it appears that the assumptions for the two exponents in x**2+x**-2 are pointing to the same object after pickling.

In [1]: from pickle import dumps, loads

In [2]: f = x**2+x**-2

In [3]: g = loads(dumps(f))

In [4]: f0 = f.args[0].args[1] # 2

In [5]: f1 = f.args[1].args[1] # -2

In [6]: g0 = g.args[0].args[1] # 2

In [7]: g1 = g.args[1].args[1] # -2

In [8]: f0.evalf()
Out[8]: 2.00000000000000

In [9]: f1.evalf()
Out[9]: -2.00000000000000

In [10]: g0.evalf()
Out[10]: 2.00000000000000

In [11]: g1.evalf()
Out[11]: -2.00000000000000

In [12]: f0.is_negative
Out[12]: False

In [13]: f1.is_negative
Out[13]: True

In [14]: g0.is_negative
Out[14]: False

In [15]: g1.is_negative
Out[15]: False

In [16]: f0._assumptions is f1._assumptions
Out[16]: False

In [17]: g0._assumptions is g1._assumptions
Out[17]: True

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to