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

Question: should we raise ValueError for things like I > x?

In [Python 3.2.2]
1 > "1"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unorderable types: int() > str()

Or maybe we should introduce a special exception, to be able handle it.


Also now in SymPy the Min/Max somehow catch it:

    >>> Min(x, zoo)
    ValueError: The argument 'zoo' is not comparable.
    >>> Min(1, I)
    ValueError: The argument 'I' is not comparable.

And treat oo as it is in ExtendedReal.
    >>> Min(1, oo)
    1

See also Issue 821 (Vinzent's comment #31 about 'is_comparable' that it has a sense for relations, but not for object, though we didn't implement so for Max/Min function and catch 'is_comparable' as connected with object.

The others tests are:
https://github.com/sympy/sympy/blob/master/sympy/functions/elementary/tests/test_miscellaneous.py

(I hope that they still will be correct if this issue will be fixed.)


And (in principle only), we can compare complex numbers with each other by the norm, which must be defined (differently) for comparable objects.



--
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