Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Random832 Newsgroups: comp.lang.python Subject: Re: Operator precedence problem Date: Mon, 06 Jun 2016 14:44:12 -0400 Lines: 10 Message-ID: References: <816c651a-d0ae-4e23-a5b2-72a8f7398468@googlegroups.com> <3ff71354-461a-4635-8d1a-c879243e39a8@googlegroups.com> <2a577a90-3a39-4d8f-90fa-4a00fd4f06a3@googlegroups.com> <1465221421.1069788.629246361.60094337@webmail.messagingengine.com> <5755adcc$0$1605$c3e8da3$5496439d@news.astraweb.com> <1465238652.1130239.629575665.537F855D@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de FStluJ7sVOrLDmuEN8DslgP/c0AGU/WwxO6sHUuF4hcw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'received:internal': 0.09; '"and"': 0.16; '"or"': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'precedence.': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'subject:problem': 0.22; 'header:In-Reply- To:1': 0.24; 'mon,': 0.24; 'right.': 0.27; 'though,': 0.32; "d'aprano": 0.33; 'doubt': 0.33; 'steven': 0.33; 'to:addr:python- list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'thought': 0.37; 'received:66': 0.38; 'to:addr:python.org': 0.40; 'forget': 0.60; 'header:Message-Id:1': 0.61; 'between': 0.65; '(why': 0.84; 'mystery': 0.95 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=ZfSIJgyY59YOMQyS9Ega5yCbzvc=; b=dGvdP7 KScTh9v+3qmzXYaZJa9+AnAHHcjnwBv7xj3yJi0e+wr+8wPJkm8+v7XFdJf0JnAk 2j7bYwMQUVxeEdgBvvqnLTQ8HEw4JoHcBnGsv+AtdYzP8lDnyDW8V5grDd7BAGUx FDmvoIYj3x2Wc4be1Y8VmuOrc4umsIoy2ydvw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=ZfSIJgyY59YOMQy S9Ega5yCbzvc=; b=JAD07aCoV6xFFRYiQoLVSO+xkafPPLVjoqMW/uZ3sfOl+aY pN4sRcIoS/3EP+8BMo3VfwcmqKrRuSpL37jz5xKftKL/96sRsCJiI8QZwRoRQOyL 0lCDMJ+b0FOE+2szeKq96wvjnb9oUE81xTLoSvPBw8QMxjE1NHawGDvOV+Co= X-Sasl-Enc: JVNCHD9SGKpnkiqjX4lOGuVNjgzLZzWea64hfcaCqwGH 1465238652 X-Mailer: MessagingEngine.com Webmail Interface - ajax-7f2506ab In-Reply-To: <5755adcc$0$1605$c3e8da3$5496439d@news.astraweb.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <1465238652.1130239.629575665.537F855D@webmail.messagingengine.com> X-Mailman-Original-References: <816c651a-d0ae-4e23-a5b2-72a8f7398468@googlegroups.com> <3ff71354-461a-4635-8d1a-c879243e39a8@googlegroups.com> <2a577a90-3a39-4d8f-90fa-4a00fd4f06a3@googlegroups.com> <1465221421.1069788.629246361.60094337@webmail.messagingengine.com> <5755adcc$0$1605$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:109587 On Mon, Jun 6, 2016, at 13:07, Steven D'Aprano wrote: > Blimey, you're right. I always thought `and` and `or` had the same > precedence. And now that I know better, I have no doubt that I will > forget > it again. A good way to remember it is that "and" is analogous to multiplication, and "or" is analogous to addition. Which is, I assume, _why_ they have the same precedence. (why ^ is between | and &, though, is a mystery to me.)