Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'operator': 0.03; 'subject:code': 0.07; 'python': 0.09; 'operator,': 0.09; 'cc:addr :python-list': 0.10; 'evaluates': 0.16; 'operands': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'wrote:': 0.17; 'equivalent': 0.20; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'first,': 0.27; 'order.': 0.27; 'rules': 0.27; 'received:209.85.210.46': 0.27; 'received:mail- pz0-f46.google.com': 0.27; 'message-id:@mail.gmail.com': 0.27; 'arithmetic': 0.29; 'comparison': 0.29; "d'aprano": 0.29; 'steven': 0.29; 'evaluation': 0.30; 'could': 0.32; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'where': 0.40; 'header:Received:5': 0.40; 'first': 0.61; 'evaluate': 0.62; 'jul': 0.65; 'talking': 0.66; 'different.': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=F+EhBias5L6OFdwEim0AVxW+4jUr/JxIpp1fOus5d9Y=; b=sKo2Xunc4A0SGtFYfQSjPn9EV940OD5HwsW9MexDioXHqpBn/BOFYsK+9qPgzsyKNA DCLaBdk3+1O3Jfw4VQw5kc1WbDaANcRi8f1r07IcSYtWIBp6ApgSv9+yM294OO55xV4P 5idcpck1p9ItaRGPpDZj+bmtMKzucOYYSKAsIMC0Xtkg6CBU7G6T7c6FXNsxMLFDkQ3h n0syV297wTDzxdnW+rlF7SIJv1MAzb95ekmQV4rXd7UhG6yjm/ZwUCNxOq9BwCPz7xbj 3GvMJ1eyzzYDxqzliCVYvVx3La96lPLcW5lj6GseO3LZvnbfzz6H4AveNWchkllpt/uh JF1g== MIME-Version: 1.0 In-Reply-To: <4ff0f939$0$29988$c3e8da3$5496439d@news.astraweb.com> References: <6c39594f-79cb-4d4f-967e-bbc3f68cdbdf@f8g2000pbf.googlegroups.com> <4fed59b7$0$29978$c3e8da3$5496439d@news.astraweb.com> <2662370.TGmo96CKe1@PointedEars.de> <87wr2oecf6.fsf@dpt-info.u-strasbg.fr> <4FEF7117.7000109@jollybox.de> <4fefb0ad$0$29988$c3e8da3$5496439d@news.astraweb.com> <4fefcf72$0$29988$c3e8da3$5496439d@news.astraweb.com> <4fefedd8$0$29988$c3e8da3$5496439d@news.astraweb.com> <4ff0f939$0$29988$c3e8da3$5496439d@news.astraweb.com> From: Devin Jeanpierre Date: Sun, 1 Jul 2012 21:50:29 -0400 Subject: Re: code review To: "Steven D'Aprano" Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1341193872 news.xs4all.nl 6966 [2001:888:2000:d::a6]:46199 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:24759 On Sun, Jul 1, 2012 at 9:28 PM, Steven D'Aprano wrote: > Technically, < in Python is left-associative: a < b < c first evaluates > a, not b or c. But it is left-associative under the rules of comparison > operator chaining, not arithmetic operator chaining. Left-associativity is when a < b < c is equivalent to (a < b) < c. You're talking about evaluation order, which can be different. For example, hypothetically, (a < b) < c could evaluate c first, then b, then a. However, Python always evaluates operands left-to-right. A particular case where this comes into play is the ** operator, which is right-associative but still has a left-to-right evaluation order. -- Devin