Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.news-service.com!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.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'operator': 0.05; 'fashion.': 0.07; 'linear': 0.07; 'reason.': 0.07; 'symbols': 0.07; 'python': 0.08; 'rule.': 0.09; "people's": 0.15; 'beginning.': 0.16; 'calculation': 0.16; 'expression,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'parentheses': 0.16; 'rantingrick': 0.16; 'sane': 0.16; 'subtraction': 0.16; 'wrote:': 0.16; 'slightly': 0.19; 'skip:m 30': 0.19; 'math': 0.21; 'header:In-Reply-To:1': 0.22; 'pm,': 0.24; 'aug': 0.24; 'up!': 0.24; "i'm": 0.27; 'message- id:@mail.gmail.com': 0.29; 'changing': 0.31; 'to:addr:python- list': 0.33; 'uses': 0.35; 'fri,': 0.36; 'using': 0.37; 'but': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'should': 0.38; 'subject:: ': 0.39; 'why': 0.39; 'to:addr:python.org': 0.39; 'more': 0.60; 'subject': 0.61; 'demand': 0.66; 'as:': 0.70; 'glad': 0.70; 'concept': 0.72; 'expectations': 0.73; 'subject:line': 0.73; '...where': 0.84; 'everything.': 0.84; 'violate': 0.84; 'violating': 0.84; 'musical': 0.93; 'safer': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=nHJlww7fUxUQHvwXQejzFkGL+8nxQQGn1JrT512lhZY=; b=pTS6OrHxuIuoQojHgG1iMJcKZskgZfbj+2LcFIGl7XUt+U6YOVd4LACbArejjpIk/f rJOYXSgr7aeULvF993qB1agKzm+dh2mLa1hg779jBhLn93eEHX8V05HZ0DiV2fLsT806 vOuGhGKnF5xHtif9vzbZmYLuUH6KwiEe7t7V0= MIME-Version: 1.0 In-Reply-To: <92b8f192-d7fc-4c60-87ad-71b12652f3a2@k8g2000yqk.googlegroups.com> References: <1312951356.77394.YahooMailNeo@web121518.mail.ne1.yahoo.com> <1312981104.89312.YahooMailNeo@web121520.mail.ne1.yahoo.com> <1312982377.95657.YahooMailNeo@web121508.mail.ne1.yahoo.com> <87fwl9hr4r.fsf@benfinney.id.au> <4e43cb2a$0$29986$c3e8da3$5496439d@news.astraweb.com> <74c2421f-28a0-4a8d-bf74-4eebacfb74f1@d7g2000vbv.googlegroups.com> <92b8f192-d7fc-4c60-87ad-71b12652f3a2@k8g2000yqk.googlegroups.com> Date: Fri, 12 Aug 2011 21:09:56 +0100 Subject: Re: allow line break at operators From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1313179799 news.xs4all.nl 23886 [2001:888:2000:d::a6]:35062 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11303 On Fri, Aug 12, 2011 at 6:57 PM, rantingrick wrote: > I'm glad you brought this up! How about this instead: > > =A0 =A0a =3D x + y * z > > ...where the calculation is NOT subject to operator precedence? I > always hated using parenthesis in mathematical calculations. All math > should resolve in a linear fashion. 3+3*2 should always be 12 and NOT > 9! Why is left-to-right inherently more logical than multiplication-before-addition? Why is it more logical than right-to-left? And why is changing people's expectations more logical than fulfilling them? Python uses the + and - symbols to mean addition and subtraction for good reason. Let's not alienate the mathematical mind by violating this rule. It would be far safer to go the other way and demand parentheses on everything. Incidentally, in the original expression, it would be slightly more sane to write it as: a =3D x + y) * z borrowing from the musical concept that a repeat sign with no corresponding begin-repeat means to repeat from the beginning. But both of these violate XKCD 859.