30 is True

2010-09-15 Thread Yingjie Lan
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

Re: 30 is True

2010-09-15 Thread Michael Ricordeau
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

Re: 30 is True

2010-09-15 Thread Peter Otten
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

Re: 30 is True

2010-09-15 Thread Jussi Piitulainen
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

Re: 30 is True

2010-09-15 Thread Mel
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

Re: 30 is True

2010-09-15 Thread Michael Ricordeau
(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

Re: 30 is True

2010-09-15 Thread Jon Siddle
)), ('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

Re: 30 is True

2010-09-15 Thread Yingjie Lan
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