Hi,
I am not sure how to interprete this, in the interactive mode:
30 is True
False
(30) is True
True
3 (0 is True)
True
Why did I get the first 'False'? I'm a little confused.
Thanks in advance for anybody who shed some light on this.
YL
--
http://mail.python.org/mailman
Because is operator take precedence on operator .
Le Wed, 15 Sep 2010 05:34:06 -0700 (PDT),
Yingjie Lan lany...@yahoo.com a écrit :
Hi,
I am not sure how to interprete this, in the interactive mode:
30 is True
False
(30) is True
True
3 (0 is True)
True
Why did I get the first
Yingjie Lan wrote:
I am not sure how to interprete this, in the interactive mode:
30 is True
False
(30) is True
True
3 (0 is True)
True
Why did I get the first 'False'? I'm a little confused.
http://docs.python.org/reference/expressions.html#notin
Unlike C, all comparison
Yingjie Lan writes:
I am not sure how to interprete this, in the interactive mode:
30 is True
False
(30) is True
True
3 (0 is True)
True
Why did I get the first 'False'? I'm a little confused.
It is interpreted as equivalent to this:
3 0 and 0 is True
False
From
Yingjie Lan wrote:
I am not sure how to interprete this, in the interactive mode:
30 is True
False
(30) is True
True
3 (0 is True)
True
Why did I get the first 'False'? I'm a little confused.
Thanks in advance for anybody who shed some light on this.
This looks like comparison
(PDT),
Yingjie Lan lany...@yahoo.com a écrit :
Hi,
I am not sure how to interprete this, in the interactive mode:
30 is True
False
(30) is True
True
3 (0 is True)
True
Why did I get the first 'False'? I'm a little confused.
Thanks in advance for anybody who
)), ('is', Name('True'))])
As you can see, it's not the same. Two comparisons are being done at
once, not
one comparison on the result of another.
Hope this helps
On 15/09/10 13:34, Yingjie Lan wrote:
Hi,
I am not sure how to interprete this, in the interactive mode:
30 is True
False
(30) is True
From: Jon Siddle j...@corefiling.co.uk
Subject: Re: 30 is True
To: python-list@python.org
Date: Wednesday, September 15, 2010, 5:04 PM
As others have said, it's not
a matter of precendence. Using the
compiler module
you can see how python actually parses this:
3 (0 is True)
Compare