In java you can speed up execution of the boolean expression if using a double operand like &&
or ||
.
Is there anything like this in python?
Clarification for those unfamiliar with Java: When I have a logical Java expression consisting of several parts, e.g. p & q & r
, at runtime JRE will have to evaluate every part to get the result. If I am writing this as p && q && r
, and say my p
is false, JRE will stop evaluating the whole expression before reaching q
and will return False.