Re: (no) fast boolean evaluation ? missing NOT

2007-08-05 Thread Gabriel Genellina
En Fri, 03 Aug 2007 11:56:07 -0300, Roel Schroeven <[EMAIL PROTECTED]> escribió: > Paul Boddie schreef: >> On 3 Aug, 11:45, Stef Mientki <[EMAIL PROTECTED]> wrote: >>> Sorry, my question missed the essential "NOT", >>> here is an example, that behaves different in Delphi, >>> (so I guess Delphi

Re: (no) fast boolean evaluation ? missing NOT

2007-08-03 Thread Terry Reedy
"Stef Mientki" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | John Machin wrote: | So now I'm left with just one question: | for bitwise operations I should use &, |, ^ | for boolean operations I should use and, or, xor | but after doing some test I find strange effects: | >>> A =

Re: (no) fast boolean evaluation ? missing NOT

2007-08-03 Thread Roel Schroeven
Paul Boddie schreef: > On 3 Aug, 11:45, Stef Mientki <[EMAIL PROTECTED]> wrote: >> Sorry, my question missed the essential "NOT", >> here is an example, that behaves different in Delphi, >> (so I guess Delphi is not a real language ;-) > > Delphi is based on Pascal, and from what I can recall from

Re: (no) fast boolean evaluation ? missing NOT

2007-08-03 Thread Paul Boddie
On 3 Aug, 11:45, Stef Mientki <[EMAIL PROTECTED]> wrote: > > Sorry, my question missed the essential "NOT", > here is an example, that behaves different in Delphi, > (so I guess Delphi is not a real language ;-) Delphi is based on Pascal, and from what I can recall from my university textbook, the

Re: (no) fast boolean evaluation ? missing NOT

2007-08-03 Thread Bruno Desthuilliers
Stef Mientki a écrit : (snip) > Gabriel: you pointed me to this page: > The exact behavior is defined in the Language Reference > > > > or_test ::= and_test | or_test "or" and_test > > Can you imagine, while I'm not a programmer, just a huma

Re: (no) fast boolean evaluation ? missing NOT

2007-08-03 Thread Stef Mientki
Laurent Pointal wrote: > Stef Mientki a écrit : >> >> def Some_Function (const): >> print 'Ive been here', const >> return True >> >> A = True >> >> if A and Some_Function (4 ): >> print 'I knew it was True' >> else: >> print 'I''ll never print this' >> >> >> >> Ive been here 4 >

Re: (no) fast boolean evaluation ? missing NOT

2007-08-03 Thread Diez B. Roggisch
Stef Mientki schrieb: > John Machin wrote: >> On Aug 3, 8:55 am, Ian Clark <[EMAIL PROTECTED]> wrote: >>> Stef Mientki 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 th

Re: (no) fast boolean evaluation ? missing NOT

2007-08-03 Thread Laurent Pointal
Stef Mientki a écrit : > > def Some_Function (const): > print 'Ive been here', const > return True > > A = True > > if A and Some_Function (4 ): > print 'I knew it was True' > else: > print 'I''ll never print this' > > > > Ive been here 4 > I knew it was True > > I was expec

Re: (no) fast boolean evaluation ? missing NOT

2007-08-03 Thread Stef Mientki
John Machin wrote: > On Aug 3, 8:55 am, Ian Clark <[EMAIL PROTECTED]> wrote: >> Stef Mientki 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 c