Comment #7 on issue 2587 by [email protected]: Strange printing at SymPy
Live
http://code.google.com/p/sympy/issues/detail?id=2587
Something global is being set. It may be related to the cache, but it must
also be something else too. Here are some isympy sessions. I didn't
change the numbering: these are the whole sessions. When the numbering
restarts, it means it's a new session.
These are all with the cache off:
In [1]: import pickle
In [2]: f = 1/(x**2*(x**2 + 1))
In [3]: f
Out[3]:
1
───────────
2 ⎛ 2 ⎞
x ⋅⎝x + 1⎠
In [4]: g = pickle.loads(pickle.dumps(f))
In [5]: g
Out[5]:
1
───────────
2 ⎛ 2 ⎞
x ⋅⎝x + 1⎠
In [6]: f
Out[6]:
1
───────────
2 ⎛ 2 ⎞
x ⋅⎝x + 1⎠
In [1]: import pickle
In [2]: f = 1/(x**2*(x**2 + 1))
In [3]: g = pickle.loads(pickle.dumps(f))
In [4]: g
Out[4]:
1
─────────────
2 ⎛ 1 ⎞
x ⋅⎜──── + 1⎟
⎜⎛1 ⎞ ⎟
⎜⎜──⎟ ⎟
⎜⎜ 2⎟ ⎟
⎝⎝x ⎠ ⎠
In [5]: f
Out[5]:
1
───────────
2 ⎛ 2 ⎞
x ⋅⎝x + 1⎠
In [6]: g
Out[6]:
1
─────────────
2 ⎛ 1 ⎞
x ⋅⎜──── + 1⎟
⎜⎛1 ⎞ ⎟
⎜⎜──⎟ ⎟
⎜⎜ 2⎟ ⎟
⎝⎝x ⎠ ⎠
These are with the cache on:
In [1]: import pickle
In [2]: f = 1/(x**2*(x**2 + 1))
In [3]: f
Out[3]:
1
───────────
2 ⎛ 2 ⎞
x ⋅⎝x + 1⎠
In [4]: g = pickle.loads(pickle.dumps(f))
In [5]: g
Out[5]:
1
───────────
2 ⎛ 2 ⎞
x ⋅⎝x + 1⎠
In [6]: f
Out[6]:
1
───────────
2 ⎛ 2 ⎞
x ⋅⎝x + 1⎠
In [1]: import pickle
In [2]: f = 1/(x**2*(x**2 + 1))
In [3]: g = pickle.loads(pickle.dumps(f))
In [4]: g
Out[4]:
1
─────────────
2 ⎛ 1 ⎞
x ⋅⎜──── + 1⎟
⎜⎛1 ⎞ ⎟
⎜⎜──⎟ ⎟
⎜⎜ 2⎟ ⎟
⎝⎝x ⎠ ⎠
In [5]: f
Out[5]:
1
─────────────
2 ⎛ 1 ⎞
x ⋅⎜──── + 1⎟
⎜⎛1 ⎞ ⎟
⎜⎜──⎟ ⎟
⎜⎜ 2⎟ ⎟
⎝⎝x ⎠ ⎠
In [6]: g
Out[6]:
1
─────────────
2 ⎛ 1 ⎞
x ⋅⎜──── + 1⎟
⎜⎛1 ⎞ ⎟
⎜⎜──⎟ ⎟
⎜⎜ 2⎟ ⎟
⎝⎝x ⎠ ⎠
--
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.