Home

Stef Mientki a écrit :
> hello,
>
> I discovered that boolean evaluation in Python is done "fast"
> (as soon as the condition is ok, the rest of the expression is ignored).
>
> Is this standard behavior or is there a compiler switch to turn it on/off ?

As it was replied, its standard behavior and cannot be modified.

IMHO, if you really need all your expressions to be evaluated, the clean
(most readable) way may be:

a = <first_expression which must be evaluated>
b = <second_expression(x,y,z) which must be evaluated>
if a and b :
...

A+

Laurent.

previous
next

Re: toprettyxml messes up with whitespaces
Re: C++ compiler about version 4.3 and an odd error of a compilation.
Re: ??????urllib post????????????
Re: sentry member class
Re: C/C++ guidelines
Mimo Wszystko
Fundacja Sloneczko
Kidprotect
Dzieci Niczyje
Niechciane i Zapomniane