Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.04; 'subject:two': 0.07; 'english,': 0.09; 'subject:into': 0.09; 'translate': 0.10; 'python': 0.11; '10:05': 0.16; 'believes': 0.16; 'brackets': 0.16; 'delimit': 0.16; 'expression.': 0.16; 'fabio': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'iterating': 0.16; 'program...': 0.16; 'subject:based': 0.16; 'ternary': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'example': 0.22; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'subject:list': 0.30; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'comments': 0.31; 'though.': 0.31; 'another': 0.32; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'c++': 0.36; "i'll": 0.36; 'subject:?': 0.36; 'too': 0.37; 'list': 0.37; 'process,': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'explain': 0.39; '12,': 0.39; 'aside': 0.39; 'generating': 0.39; 'to:addr:python.org': 0.39; 'course': 0.61; 'square': 0.74; 'rusi': 0.91; '2013': 0.98 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:to :content-type:content-transfer-encoding; bh=ay9Q6G2Ms20IIqtUpi037iiV8aW+1Z0zldwK1HZ1wfQ=; b=kPHyzmIpphh2KBJJ2rZKJIuZiGFEeU8GN1MVleUBLU3MZRD0kUeQGgjlPxYr6SjhkO Mgb1ILMCUxr55OqPmVNTxleXeqOzGZtm4Or2q/qa4jX0k6PlPpoxIWQtxBUWJ11f5MPR F2lkzimnPKMM/bGiiDVS/zaB8/bhjmAyN7etIcoQxk/ZjFjtsz94SU5AVg6NpgIWvPMM DEQ08NROvIz5z/jSIvmRuhidu6aBvDXXLBta7vM5Ds7ceMSWDghzyfi2voA3tc51RoMP Uruh8/YT0b5woaM2ClPlXWMSTCIYxHDfFrJzqLDudh8O4kA/VGTg4Zai/ot97vx6eku2 /Pwg== MIME-Version: 1.0 X-Received: by 10.52.121.99 with SMTP id lj3mr7031090vdb.52.1370972231948; Tue, 11 Jun 2013 10:37:11 -0700 (PDT) In-Reply-To: References: <37e02d07-a058-48a2-9aad-80613f2df636@a15g2000pbu.googlegroups.com> Date: Wed, 12 Jun 2013 03:37:11 +1000 Subject: Re: Split a list into two parts based on a filter? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1370972234 news.xs4all.nl 15924 [2001:888:2000:d::a6]:58797 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:47688 On Wed, Jun 12, 2013 at 3:23 AM, rusi wrote: > On Jun 11, 10:05 pm, F=E1bio Santos wrote: >> On 11 Jun 2013 17:47, "rusi" wrote: >> >> > [Of course I would prefer a 3-liner where the body of the for is >> > indented :-) ] >> >> Is this an aside comprehension? > > Eh? I know they always say "don't explain the joke", but I'll have a shot at it. It's somewhat like an autopsy though - you find out why it ticks, but in the process, you prove that it's no longer ticking... An aside comprehension is a means of generating an aside in-line, as an expression. In this case, Fabio believes that you were iterating over the smiley to generate comments about three-liners, and the square brackets delimit the comprehension just as they do in a list comprehension. It's another case of code syntax cropping up in English, like this example of ternary punctuation from a C++ program... //TODO?: blah blah blah That doesn't translate too well into Python though. ChrisA