Home

On Aug 3, 9:19 am, "Evan Klitzke" <e...@yelp.com> wrote:
> On 8/2/07, Stef Mientki <S.Mientki-nos...@mailbox.kun.nl> wrote:
>
> > 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 ?
>
> This is standard behavior in every language I've ever encountered. If
> you are evaluating an and/or with side effects and you need both side
> effects to occur, you can trivially write functions implementing this
> behavior, e.g.
>

If each operand is of type bool (or, more generally,
isinstance(operand, int) is true), you could trivially use the & and |
operators.

previous
next

Re: str().join() isn't working
Re: The Modernization of Emacs: terminology buffer and keybinding
Re: How do I get the value out of a DOM Element
Re: Is there a nicer way to do this?
Re: Faster std::map?
medycyna estetyczna lublin
midface lift
wzory tatuaży
Szkoła policealna technik bhp warszawa
pozycjonowanie rzeszów