And/Or returns truth value even for expression with Symbols

27 views
Skip to first unread message

Duane Nykamp

unread,
Jan 20, 2015, 6:39:49 PM1/20/15
to sy...@googlegroups.com
 Comparisons that are undetermined depending on values of Symbols are not supposed to return a truth value.  E.q., the following works correctly:

In [2]: bool(Eq(x,5))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

[snip]

TypeError: cannot determine truth value of Relational


(and similar exception for bool(Eq(x,6)), of course)


However, shouldn't the following also return a TypeError saying it cannot determine a truth value?


In [4]: bool(Or(Eq(x,5),Eq(x,6)))
Out[4]: True

In [7]: bool(And(Eq(x,5),Eq(x,6)))
Out[7]: True

It would seem this is a bug or am I missing something?

Duane

Aaron Meurer

unread,
Jan 20, 2015, 7:08:52 PM1/20/15
to sy...@googlegroups.com
Yep, that looks like a bug to me. 

Aaron Meurer

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/314dc79a-0962-49d6-add0-6ffae8437d4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages