Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!bcyclone03.am1.xlned.com!bcyclone03.am1.xlned.com!newsfeed.xs4all.nl!newsfeed4a.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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'latter': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:test': 0.09; '[f,': 0.16; 'ah,': 0.16; 'evaluates': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'header:X-Complaints- To:1': 0.27; 'but': 0.35; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'received:217': 0.63; 'apart': 0.72; 'subject::': 0.85 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Vito De Tullio Subject: Re: (test) ? a:b Date: Thu, 23 Oct 2014 06:55:22 +0200 References: <54476af8$0$21651$426a74cc@news.free.fr> <7839376e-fc27-4299-ae63-4ddf17ef9a8a@googlegroups.com> <7d2ea3c1-504e-4f5c-8338-501b1483df38@googlegroups.com> <7ugg4at56dail7idpd5r3eg7hkgums6r6m@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: 217.200.201.171 User-Agent: KNode/4.14.1 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1414040154 news.xs4all.nl 2833 [2001:888:2000:d::a6]:53334 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 2716 X-Received-Body-CRC: 1607618934 Xref: csiph.com comp.lang.python:79501 Dennis Lee Bieber wrote: >> x = [f(), g()] [cond] >> >>the latter evaluates both f() and g() instead of just one. Apart from >>being inefficient, it can have unintended side-effects. > > Ah, but what would > > x = [f, g][cond]() > > produce? headache -- By ZeD