Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '+++': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'compiler': 0.07; 'back.': 0.09; 'lawrence': 0.09; 'prefix': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'warn': 0.09; 'language.': 0.14; '-999': 0.16; '999': 0.16; 'compiler.': 0.16; 'operators,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:Java': 0.16; 'unary': 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'wed,': 0.18; 'implementing': 0.19; 'code,': 0.22; 'header:User-Agent:1': 0.23; "shouldn't": 0.24; '(or': 0.24; '---': 0.24; 'subject:/': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'code': 0.31; "d'aprano": 0.31; 'issuing': 0.31; 'steven': 0.31; 'but': 0.35; 'possible': 0.36; 'should': 0.36; 'two': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'expression': 0.60; 'mentioned': 0.61; 'our': 0.64; 'charset:windows-1252': 0.65; 'nobody': 0.68; 'prohibited': 0.69; 'legal': 0.71; 'apart': 0.72; 'upper': 0.74; 'day': 0.76; '2015': 0.84; 'absolutely.': 0.84; 'detecting': 0.84; 'horrible': 0.84; 'horse': 0.84; 'subject:experience': 0.84; 'ugly,': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Bitten by my C/Java experience Date: Wed, 06 May 2015 21:13:23 +0100 References: <87r3qwid3u.fsf@Equus.decebal.nl> <55487d30$0$2917$c3e8da3$76491128@news.astraweb.com> <3Zn2x.359727$Ox2.83653@fx23.am4> <554a3b37$0$12985$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-78-147-26-50.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 In-Reply-To: <554a3b37$0$12985$c3e8da3$5496439d@news.astraweb.com> 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: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1430943218 news.xs4all.nl 2955 [2001:888:2000:d::a6]:43515 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90070 On 06/05/2015 17:03, Steven D'Aprano wrote: > On Wed, 6 May 2015 10:40 pm, BartC wrote: > >> But I had in mind not implementing ++ and --, but detecting them and >> issuing a warning, > > That's a job for a linter, not the compiler. The compiler should be as > flexible as possible in what it accepts: > > > a , b=12+3 * 4,"hello" . upper () > > > is perfectly legal code. The compiler shouldn't force you to write good > looking code, apart from what is prohibited altogether. > > Both + and - are unary prefix operators, so you can apply + and - to any > expression -- even an expression that already has a unary prefix operator: > > py> - --- +++ + - - + -- +++ --- 999 > -999 > > > Is that ugly, horrible code that nobody in their right mind would use in > production? Absolutely. But the compiler can and should accept it, and > linters (or human reviewers) should warn about it. > Linters were mentioned a day or two back. Take a horse to water... -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence