Brian and Vincent, Thanks for explaining. If I understand you correctly, the decision is that a>b should only be used in the mathematical meaning. I have also learned (from Vincent I think) that cmp(a,b) will be removed from python 3. What I don't understand then is how Sympy objects can be sorted? If __lt__, __gt___, etc. are overloaded to construct objects, and __cmp__ is deprecated, what is the plan for canonical ordering?
Øyvind On 31 Mar, 23:02, Vinzent Steinberg <[email protected]> wrote: > On Mar 30, 7:43 pm, Brian Granger <[email protected]> wrote: > > > The reason is that the __nonzero__ methods of different Relational > > subclasses use the .compare method in different ways. I didn't write > > this code, BUT I seem to remember that many tests fail if you simply > > have __nonzero__ return True. I didn't investigate why, but my guess > > is that this is used to order different Relationals in expressions. > > This is imho a bug that should be fixed. Such things should not be > used for ordering, this is not a clean approach and this should also > be fixed. > > Vinzent -- You received this message because you are subscribed to the Google Groups "sympy" 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?hl=en.
