Updates:
        Labels: -Priority-Medium Priority-High

Comment #1 on issue 2832 by [email protected]: bool(Relational) should raise ValueError
http://code.google.com/p/sympy/issues/detail?id=2832

There are some serious inconsistencies going on here. The problem is that we are lazy about relational evaluation, passing > and >= to < and <=. In fact, those are respectively for Number, even though that is **wrong**:

 def __gt__(self, other):
     return _sympify(other).__lt__(self)
 def __ge__(self, other):
     return _sympify(other).__le__(self)

(I believe this is not causing serious problems because all the subclasses currently override these methods).

But even without that bug, this leads to inconsistencies, especially with nan, which tries to make all comparisons False, like

In [86]: nan > 0
Out[86]: False

In [87]: nan >= 0
Out[87]: True

In [98]: oo > nan
Out[98]: True

In [99]: nan < oo
Out[99]: False

Also, comparisons against complex numbers are allowed, even though these can never be made to be consistant (at least arithmetically, but as you can see with nan, it's not so easy to make these things transitively consistant).

So part of the issue here is to raise ValueError also for comparisons of non-real numbers (real here includes +/- oo).

Question: should we raise ValueError for things like I > 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.

Reply via email to