Hi!
Is there a way (using eval
or whatever) to evaluate eagerly boolean expressions in python?
Let's see this:
>>> x = 3
>>> 5 < x < y
False
Yikes! That's very nice, because this will be false regardless of y
's value. The thing is, y
can be even undefined, and I'd like to get that exception. How can I get python to evaluate all expressions even if it knows the result beforehand?
Hope I made myself clear! Thanks,
Manuel
Edit: Please bear in mind that the expression must not be modified, just the evaluation technique.