Logic operators with "in" statement

Xavier Ho contact at xavierho.com
Mon Nov 16 19:32:43 EST 2009


On Tue, Nov 17, 2009 at 12:46 AM, Chris Rebert <clp2 at rebertia.com> wrote:

> On Mon, Nov 16, 2009 at 6:23 AM, Xavier Ho <contact at xavierho.com> wrote:
> > AND operator has a higher precedence, so you don't need any brackets
> here, I
> > think. But anyway, you have to use it like that. So that's something
> you'll
> > have to fix first.
>
> Er, you mean lower precedence. Higher precedence means it would bind
> tighter, thus the expression would mean:
> '3' in (l and 'no3') in l
> which is certainly incorrect.
>
>
Thanks for the correction, Chris.

Cheers,
Xav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091117/374c6b31/attachment-0001.html>


More information about the Python-list mailing list