On Mon, 18 Aug 2008 18:27:53 +0200, Peter Otten wrote:
> Dan Lenski wrote:
>> How does this play with standard precedence rules?
>
> Simple, all comparisons have the same priority:
>
> http://docs.python.org/ref/comparisons.html
>
> Peter
I see. So, since the comparison operators have lower p
[EMAIL PROTECTED] wrote:
3 in [3] == True
http://docs.python.org/ref[3/summary.html
that page is broken, as recently mentioned; "in", "not in", "is", and
"is not" are comparison operators too, chains in the same way as the
others. for details, see:
http://docs.python.org/ref/compari
On Aug 18, 12:04 pm, Peter Otten <[EMAIL PROTECTED]> wrote:
> George Sakkis wrote:
> > I'm probably missing something obvious but I can't put my finger on
> > it:
>
> (3 in [3]) == True
> > True
>
> 3 in ([3] == True)
> > Traceback (most recent call last):
> > File "", line 1, in
> >
Dan Lenski wrote:
> On Mon, 18 Aug 2008 18:04:32 +0200, Peter Otten wrote:
>> This works just like a < b < c:
>>
> 3 in [3] and [3] == True
>> False
> Interesting. I agree with the OP that it is confusing!
>
> Does this expansion really get invoked every time there is an expression
> of th
On Aug 18, 5:57 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
> I'm probably missing something obvious but I can't put my finger on
> it:
>
> >>> (3 in [3]) == True
>
> True
>
> >>> 3 in ([3] == True)
>
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: argument of type 'bool
On Mon, 18 Aug 2008 18:04:32 +0200, Peter Otten wrote:
> This works just like a < b < c:
>
3 in [3] and [3] == True
> False
>
> Peter
Interesting. I agree with the OP that it is confusing!
Does this expansion really get invoked every time there is an expression
of the form??
expr1 binar
George Sakkis wrote:
> I'm probably missing something obvious but I can't put my finger on
> it:
>
(3 in [3]) == True
> True
>
3 in ([3] == True)
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: argument of type 'bool' is not iterable
>
3 in [3] == True
I'm probably missing something obvious but I can't put my finger on
it:
>>> (3 in [3]) == True
True
>>> 3 in ([3] == True)
Traceback (most recent call last):
File "", line 1, in
TypeError: argument of type 'bool' is not iterable
>>> 3 in [3] == True
False
How/why does the last one evaluate t