Paul Hankin wrote:
> Did you try to find the answer to your question in the python
> reference manual? The relevant page is
> http://docs.python.org/ref/Booleans.html
Of course I first Googled (even Google Groups-ed) it, but I didn't notice
that in the results.
> To quote it:
> The expression '
> if () and () and ():
> do_something()
>
> Is there a guarantee that Python will evaluate those conditions in order (1,
> 2, 3)? I know I can write that as a nested if, and avoid the problem
> altogether, but now I'm curious about this ;).
Yes, Python does short-circuit evaluation, from left-t
On Feb 25, 9:18 pm, Karlo Lozovina <[EMAIL PROTECTED]> wrote:
> Hi all! Here is what's bugging me: let's say I have this code:
>
> if () and () and ():
> do_something()
>
> Is there a guarantee that Python will evaluate those conditions in order (1,
> 2, 3)? I know I can write that as a nested if
Hi all! Here is what's bugging me: let's say I have this code:
if () and () and ():
do_something()
Is there a guarantee that Python will evaluate those conditions in order (1,
2, 3)? I know I can write that as a nested if, and avoid the problem
altogether, but now I'm curious about this ;).
Th