Updates:
Cc: [email protected]
Comment #18 on issue 2587 by [email protected]: Strange printing at SymPy
Live
http://code.google.com/p/sympy/issues/detail?id=2587
Well, I looked into it, and not pickling _assumptions at all is not the
answer. The problem is that, as far as I can tell, it's impossible to
differentiate between assumptions that should be copied because they were
set on an object (like Symbol('x', positive=True)), and those that can be
recomputed from other information (like Integer(2).is_positive). Unless
someone can come up with a clean solution on the SymPy side. Perhaps I'm
missing something (e.g., is there a way to set inside SymPy to not optimize
_assumptions in pickling?).
Since this would require a rewrite of the assumptions system, I think it's
not worth it, as we plan on dumping the old assumptions system anyway. So
for now, I think we should just go with your fix in SymPy Live. This needs
to be tested more, but it's probably OK.
By the way, go ahead and use dumps(obj, -1) to use the highest protocol.
This should be more efficient.
Other than that, we should add an XFAIL test for this in SymPy
(sympy/utilities/tests/test_pickling.py), and perhaps document this
somewhere.
--
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.