Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!newsfeed.xs4all.nl!newsfeed3a.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.018 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:test': 0.09; 'conditional': 0.16; 'hack,': 0.16; 'outdated': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.18; 'bit': 0.19; '>>>': 0.22; 'appears': 0.22; 'header:User-Agent:1': 0.23; 'post': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'especially': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'earth': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'first': 0.61; 'email addr:gmail.com': 0.63; 'batchelder': 0.84; 'subject::': 0.85; 'not:': 0.91; 'sorry.': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ned Batchelder Subject: Re: (test) ? a:b Date: Wed, 22 Oct 2014 16:11:45 -0400 References: <54476af8$0$21651$426a74cc@news.free.fr> <7839376e-fc27-4299-ae63-4ddf17ef9a8a@googlegroups.com> <5447db41$0$13000$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 18.189.53.17 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <5447db41$0$13000$c3e8da3$5496439d@news.astraweb.com> 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1414008712 news.xs4all.nl 2844 [2001:888:2000:d::a6]:48800 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3327 X-Received-Body-CRC: 1171113993 Xref: csiph.com comp.lang.python:79468 On 10/22/14 12:28 PM, Steven D'Aprano wrote: > Ned Batchelder wrote: > >> On 10/22/14 5:05 AM, buscacio@gmail.com wrote: > >>> without not: >>> j = [j+1, 3][j>=10] >>> with not: >>> j = [3, j+1][not (j>=10)] >>> >> >> Why on earth would you recommend this outdated hack, when there's a true >> conditional operator? >> >> j = 3 if j >= 10 else j+1 > > I think that's a bit harsh. Especially since this appears to have been > Buscacio's first post here. Hopefully not his(?) last post! You are right, it sounds a bit harsh. Sorry. -- Ned Batchelder, http://nedbatchelder.com