Ed Leafe a écrit :
On Aug 3, 2007, at 11:57 AM, Bruno Desthuilliers wrote:
Sorry, I forgot to mention the language did not allow to have else if
in the same statement. IOW :
if some_condition then
do_sometehing
else
if some_other_condition then
do_something_else
else
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 is not a real
On Aug 4, 5:33 pm, Paddy [EMAIL PROTECTED] wrote:
On Aug 4, 4:18 pm, Paddy [EMAIL PROTECTED] wrote:
On Aug 2, 10:47 pm, Stef Mientki [EMAIL PROTECTED]
wrote:
hello,
I discovered that boolean evaluation in Python is done fast
(as soon as the condition is ok, the rest of the
On Aug 2, 10:47 pm, Stef Mientki [EMAIL PROTECTED]
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 ?
thanks,
Stef
On Aug 4, 4:18 pm, Paddy [EMAIL PROTECTED] wrote:
On Aug 2, 10:47 pm, Stef Mientki [EMAIL PROTECTED]
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
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
Stef Mientki a écrit :
Python
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'
/Python
Output
Ive been here 4
I knew it was True
/Output
I
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 compiler switch to
Stef Mientki a écrit :
(snip)
Gabriel: you pointed me to this page:
The exact behavior is defined in the Language Reference
http://docs.python.org/ref/Booleans.html
quote
or_test ::= and_test | or_test or and_test
/quote
Can you imagine, while I'm not a programmer, just a
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 my
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, there
Steven D'Aprano a écrit :
On Fri, 03 Aug 2007 10:20:59 +0200, Bruno Desthuilliers wrote:
Joshua J. Kugler a écrit :
On Thursday 02 August 2007 15:19, Evan Klitzke wrote:
I discovered that boolean evaluation in Python is done fast
(as soon as the condition is ok, the rest of the expression
Joshua J. Kugler a écrit :
On Thursday 02 August 2007 15:19, Evan Klitzke wrote:
I discovered that boolean evaluation in Python is done fast
(as soon as the condition is ok, the rest of the expression is ignored).
This is standard behavior in every language I've ever encountered.
Then
On 2007-08-03, Steven D'Aprano [EMAIL PROTECTED] wrote:
But that's specific to the syntax of the language. You could,
if you choose, design a language where elif was unnecessary:
if condition:
pass
else if another_condition:
pass
What advantage is there to elif, apart from it
Laurent Pointal wrote:
Stef Mientki a écrit :
Python
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'
/Python
Output
Ive been here 4
I knew it
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 this standard behavior or is
On Aug 3, 2007, at 11:57 AM, Bruno Desthuilliers wrote:
Sorry, I forgot to mention the language did not allow to have else
if
in the same statement. IOW :
if some_condition then
do_sometehing
else
if some_other_condition then
do_something_else
else
if
On Fri, 03 Aug 2007 10:20:59 +0200, Bruno Desthuilliers wrote:
Joshua J. Kugler a écrit :
On Thursday 02 August 2007 15:19, Evan Klitzke wrote:
I discovered that boolean evaluation in Python is done fast
(as soon as the condition is ok, the rest of the expression is ignored).
This is
John Machin wrote:
(you_are_confused and/or
function_returns_bool_but_has__side_effects())
That above expression should be written more explicitly like:
function_result = function_returning_bool_but_with_side_effects()
if you_are_confused or function_result:
do_something_nice()
On 2007-08-03, Ed Leafe [EMAIL PROTECTED] wrote:
On Aug 3, 2007, at 11:57 AM, Bruno Desthuilliers wrote:
Sorry, I forgot to mention the language did not allow to have else
if
in the same statement. IOW :
if some_condition then
do_sometehing
else
if some_other_condition then
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 = 4
| B
Ian Clark 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 compiler switch to turn it
on/off ?
It's called short circuit
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 ?
thanks,
Stef Mientki
--
http://mail.python.org/mailman/listinfo/python-list
On 8/2/07, Stef Mientki [EMAIL PROTECTED] 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
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 compiler switch to turn it on/off ?
thanks,
Stef Mientki
It's called short circuit
En Thu, 02 Aug 2007 18:47:49 -0300, Stef Mientki
[EMAIL PROTECTED] escribió:
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 ?
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 compiler switch to turn it on/off
On Aug 3, 9:19 am, Evan Klitzke [EMAIL PROTECTED] wrote:
On 8/2/07, Stef Mientki [EMAIL PROTECTED] 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
On Thursday 02 August 2007 15:19, Evan Klitzke wrote:
I discovered that boolean evaluation in Python is done fast
(as soon as the condition is ok, the rest of the expression is ignored).
This is standard behavior in every language I've ever encountered.
Then you've never programmed in VB (at
29 matches
Mail list logo