Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!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.006 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; '>the': 0.16; '[f,': 0.16; 'ah,': 0.16; 'evaluates': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wed,': 0.18; 'url:home': 0.24; 'header:X-Complaints-To:1': 0.27; '+0100,': 0.31; 'but': 0.35; 'version': 0.36; 'skip:> 10': 0.36; 'charset:us-ascii': 0.36; 'being': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'apart': 0.72; 'subject::': 0.85; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: (test) ? a:b Date: Wed, 22 Oct 2014 19:55:35 -0400 Organization: IISS Elusive Unicorn References: <54476af8$0$21651$426a74cc@news.free.fr> <7839376e-fc27-4299-ae63-4ddf17ef9a8a@googlegroups.com> <7d2ea3c1-504e-4f5c-8338-501b1483df38@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-68-178-233.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 1414022143 news.xs4all.nl 2839 [2001:888:2000:d::a6]:51519 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:79484 On Wed, 22 Oct 2014 19:08:40 +0100, "BartC" declaimed the following: > >Comparing: > > x = cond ? f() : g(); # C version > >with > > 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? -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/