Am 30.06.2012 13:13, schrieb Sergiu Ivanov:
However, I'll try once again to push through the idea of defining
sympy.utilities.sympysort in the following way:
sympysort(x) = sorted(x, key=default_sort_key)
This will make the doctests which output non-Basic objects uglier, but
not less clearer with sympysort.
Doctests are code examples made executable to avoid the embarrassment of
having non-working example code.
Adding code to make the doctest pass will make the code example less
useful in its primary purpose.
Alternatively, we could push sympysort into standard equality testing.
This could be done in two ways:
1) Change SymPy to use its own equality testing function(s). I believe
that this could benefit other problems - I see recurring questions of
the "a and b should be equal but aren't" on the mailing list, and having
an array of different equality testers that work at different levels of
abstractions might help address this without the feel of ugly hacks that
the answers often carry.
2) If Python supports that, redefine Python's equality for SymPy dicts
to be agnostic of key ordering. That would push sympysort into the
equality function. (Making this efficient might be an interesting task.)
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.