1 | initial version |
I think it is a mixture of boolean and symbolics that is going on here. If I am not wrong, this is what is happening to your expression, say, (x==1) or (x==-3)
:
or
is evaluated. So, most probably bool(x==1)
is being run to find out if it evaluates to True
or False
.bool(x==1)
will always return False
, so the result of the expression becomes the result of whatever (x==-3)
is.x
is a symbolic variable and Sage by default does not evaluate an expression like x==-3
to give the truth value of the expression. What Sage does is keep the expression unmodified.This also goes into the behavior of or
and and
in Python itself. In particular, read the Note at the end of the section here. Notice how it says that and
and or
return the last evaluated argument and their output may not be restricted to True
or False
.