Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!backfill.erje.net!feeder.erje.net!eu.feeder.erje.net!ecngs!feeder2.ecngs.de!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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'read.': 0.03; 'subject:test': 0.09; 'cc:addr:python-list': 0.11; '24,': 0.16; '36,': 0.16; 'beta)': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'readability': 0.16; 'sheer': 0.16; 'skip:[ 30': 0.16; 'followed': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'error': 0.23; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; '(this': 0.29; 'wonder': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'fri,': 0.33; 'problem': 0.35; 'skip:s 30': 0.35; 'received:google.com': 0.35; 'pm,': 0.38; 'weight': 0.39; 'is.': 0.60; 'course': 0.61; 'complexity': 0.84; 'idiom': 0.84; 'subject::': 0.85; 'to:none': 0.92 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=5iY9nqUdGWaEhAmrcpQwL2npOZvKZERT9hA1vGAiDRs=; b=wUiLRuPhsKbaKv66kj23FRyvvGe+qIyGW98HAcm1bbyiokWqV77474N403f8A5HuLQ VCs16L8hiXBm7Gy7Lg1U0ydDxKZDfMxwuhpOWFP6u7b0ROtLuA7tSBx34NB05Gd+SRbL d5DVlIfuNccwmvfn7GZqMImD002H0Hr2gs/1QtTc02sDbP7QAUPtlQLEJacq28nHHcT7 tuNWXXRW/WXwkKEiz+1I2P1sFSIfcgHcGYXXLdSnP+rOr1eYZnoHUr2hlMKbWDx7ZRrb l8i3xT1l3yoN4WvBP0sVM/tfBeIktNjQqrVt2yeLCz13+VK7fs1uTPr4Q3tRsIhPws3V Txig== MIME-Version: 1.0 X-Received: by 10.170.207.20 with SMTP id y20mr4351443yke.28.1414140326013; Fri, 24 Oct 2014 01:45:26 -0700 (PDT) In-Reply-To: <544a1016$0$13000$c3e8da3$5496439d@news.astraweb.com> References: <54476af8$0$21651$426a74cc@news.free.fr> <7839376e-fc27-4299-ae63-4ddf17ef9a8a@googlegroups.com> <7d2ea3c1-504e-4f5c-8338-501b1483df38@googlegroups.com> <878uk6x5nd.fsf@elektro.pacujo.net> <544a1016$0$13000$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 24 Oct 2014 19:45:25 +1100 Subject: Re: (test) ? a:b 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.15 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1414140334 news.xs4all.nl 2836 [2001:888:2000:d::a6]:56081 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79565 On Fri, Oct 24, 2014 at 7:38 PM, Steven D'Aprano wrote: > Of course one can write hard-to-read code using any idiom by sheer weight of > complexity or obfuscated naming: > > value = [some_function(arg)[23]['key'] or > another_function.method((x + y)/(z-x**(y-4)))* > some_list[get_index(a)].spam(eggs=False, tomato='yum'), > something.do_this(p|q).get(alpha, beta) ^ > aardvark.bobble("string%s" % carrot.gamma(r&s)* > (this & that).fetch(83, 36, when=when or "now") > ][cond or flag or foo(42)-1 > 17 or bar(b) < thingy(c) or not d] > I can see where your problem is. It is a cardinal error in readability to have "(x + y)" followed by "z-x". No wonder it's hard to read. ChrisA