Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed4.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.104 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.84; '*S*': 0.05; 'subject:both': 0.07; 'cc:addr:python-list': 0.11; '0):': 0.16; 'range(0,': 0.16; 'to:addr:pearwood.info': 0.16; "to:name:steven d'aprano": 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; "d'aprano": 0.31; 'piece': 0.31; 'sep': 0.31; 'steven': 0.31; 'received:google.com': 0.35; 'subject:one': 0.36; 'thank': 0.38; 'dave': 0.60; 'truly': 0.60; 'times': 0.62; 'treasure': 0.84; 'angel': 0.91; 'forever.': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=MMG/iYIRgOl5c5UycYKGonbacMU5n4S/VrhRmQHZVDM=; b=wD8gN3jV4yjyvC+U9HeXnIfFfwWMQ+SCRkly8XzDG9C2AZ279iFbQR9yMj1fSwdXP2 pcJmTckNunBLrTIxWM8UCb0FQDnympXvgxzMXsLpM4Ngeqgu59E/OP70XW7Hgy+x38SC HcEHH71yvPQb5KjLpwvHkB7Sh/ViZl2DrBZSL+2g6Yymlk2FaGbkm2vjYTgTfYvdLdmX u+R1yYavlZ8mB/UjgtgiY/xWyZL1c8n59Iw84/0g/Q2sWDVpfXKELSEo2jI/Ioc7Jima 8KjnZJ3/c/iu2+tAFyECpuoCW3vZ4g90STmb1F8cyPzw7nzeHSkvqL/A1VKGnauS8c+a IsUQ== X-Received: by 10.112.159.166 with SMTP id xd6mr33369674lbb.22.1379483783180; Tue, 17 Sep 2013 22:56:23 -0700 (PDT) MIME-Version: 1.0 Sender: joshua.landau.ws@gmail.com In-Reply-To: <52390bb0$0$29869$c3e8da3$5496439d@news.astraweb.com> References: <52390bb0$0$29869$c3e8da3$5496439d@news.astraweb.com> From: Joshua Landau Date: Wed, 18 Sep 2013 06:55:42 +0100 X-Google-Sender-Auth: Gn1a7mdvcnvK-hkHQDn9yRV6iQ4 Subject: Re: Having both if() and for() statements in one liner To: "Steven D'Aprano" Content-Type: text/plain; charset=UTF-8 Cc: python-list 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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1379483791 news.xs4all.nl 15974 [2001:888:2000:d::a6]:48465 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:54356 On 18 September 2013 03:10, Steven D'Aprano wrote: > On Tue, 17 Sep 2013 18:54:51 +0000, Dave Angel wrote: > >> for times in range(0, 5 if person=="George" else 0): > > > Oh that is evil. Truly evil. > > Thank you, I will treasure that piece of code forever. range(person == "simon" and 5)