Path: csiph.com!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.018 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'operator': 0.03; 'cc:addr :python-list': 0.09; 'python': 0.10; 'syntax': 0.13; '100,': 0.16; '120,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'readability.': 0.16; 'wrote:': 0.16; 'obviously': 0.16; 'abuse': 0.18; 'flexibility': 0.18; "shouldn't": 0.18; 'language': 0.19; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'sep': 0.22; 'am,': 0.23; 'code.': 0.23; 'decide': 0.23; 'header:In-Reply-To:1': 0.24; 'fri,': 0.27; 'not.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'to?': 0.27; 'coded': 0.29; 'comparison': 0.29; 'equally': 0.29; 'node': 0.29; 'operators': 0.29; 'spaces': 0.29; 'style.': 0.29; 'raise': 0.29; 'allows': 0.30; 'comments': 0.30; 'certainly': 0.30; 'programmers': 0.30; 'somebody': 0.30; 'strongly': 0.30; "can't": 0.32; 'language.': 0.32; 'class': 0.33; 'right?': 0.33; 'received:google.com': 0.35; 'something': 0.35; 'but': 0.36; 'should': 0.36; 'lines': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'one,': 0.37; 'skip:5 10': 0.37; 'things': 0.38; "didn't": 0.39; 'takes': 0.39; 'your': 0.60; 'no.': 0.62; 'more': 0.63; 'our': 0.64; 'limit': 0.65; "they're": 0.66; 'guides': 0.72; '100': 0.79; 'chrisa': 0.84; 'to:none': 0.91; 'stretch': 0.91; 'subject:True': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=HH0OyKtRi0dI7flP0EM5RaLZPU7Tqxrz+DJRA0fJzn0=; b=fMUweC+nHz5lSRVEb1CL4asQQhaJZRt/+TmKc4wIUumDiJx/VSjNMejugfikaZMXKw 2Aic3446RMjcGsAOMKRazu74I9PYf+AX7tW//wWEEArBmEk+KV3cbn0oChx5qJkNcC/+ J8Bwnpuho7w9W8Hk6qUJajv80snRM9zh7A6LBHwkaaMZ4I2O3HBaYaWQhA9gpSNsM5RW 8i3Ve1q5+Js0GtuZJe1kyV5RzIYXokSsg9LbwYF9ULqb83UrBdX1DQVo7XRq1pM2k6Wu WdKEW+7/k/dr1XQ8TqZGfALJ1vV5sjHZnLvxf2wGxL8zMd4XeUp0cDF1YMhXeX7LYjQ3 5DSQ== MIME-Version: 1.0 X-Received: by 10.50.98.7 with SMTP id ee7mr30593139igb.13.1442541806798; Thu, 17 Sep 2015 19:03:26 -0700 (PDT) In-Reply-To: <87vbb8hgkl.fsf@elektro.pacujo.net> References: <0b949fe0-09b4-46b0-b4ac-a85a9bfebfd5@googlegroups.com> <1442412230.1762717.385286049.20841F36@webmail.messagingengine.com> <87vbb8hgkl.fsf@elektro.pacujo.net> Date: Fri, 18 Sep 2015 12:03:26 +1000 Subject: Re: True == 1 weirdness From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1442541815 news.xs4all.nl 23806 [2001:888:2000:d::a6]:35723 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96792 On Fri, Sep 18, 2015 at 7:38 AM, Marko Rauhamaa wrote: > Random832 : > >> It being *easier to implement* to have comparison operators be a >> single class and have chaining apply equally to all of them may be an >> excuse for the language to allow it, but it's certainly not an excuse >> for *actually* using it from a standpoint of good style and >> readability. > > In general, I don't like such caveats. Either something is in the > language or it is not. > > You don't have to use all language features (I certainly don't), but if > somebody takes advantage of them, you shouldn't consider it bad style. > So if you don't like > > if prev_node is not node in excluded: > ... > > take your complaints to whoever accepted the syntax in the language. Strongly disagree. We have style guides because the language allows many things which are not good code. Given that Python programmers can't decide on whether the line limit should be 79, 80, 100, 120, or "79 but you can stretch to 100 if you have to", what should the syntax be coded to? It's just as bad style to produce a 500-character line as it is to abuse operator chaining, so should we take our complaints about over-long lines to "whoever didn't put a length limit into language syntax"? What about indenting with 5 spaces - should that have been disallowed at the language level? And what about misspelled comments - obviously they're bad style, so clearly Python should raise SyntaxError any time it comes across one, right? No. The language should be kept simple, and on matters of style, it should have MORE flexibility than we use - otherwise it's a straitjacket. ChrisA