Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news1.tnib.de!feed.news.tnib.de!news.tnib.de!newsfeed.freenet.ag!news2.euro.net!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.069 X-Spam-Evidence: '*H*': 0.86; '*S*': 0.00; 'sep': 0.09; 'sat,': 0.15; 'lambda': 0.16; 'subject:sub': 0.16; 'wrote:': 0.17; 'basically': 0.17; 'thanks,': 0.18; 'paul': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; '-0700,': 0.29; 'writes:': 0.29; 'to:addr:python-list': 0.33; 'charset:us-ascii': 0.36; 'subject:: ': 0.38; 'received:10': 0.38; 'to:addr:python.org': 0.39; 'subject:-': 0.40; 'content-disposition:inline': 0.60; 'thomas': 0.62; 'received:10.94': 0.84; 'true!': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uni-mainz.de; i=@uni-mainz.de; q=dns/txt; s=ironport; t=1348937095; x=1380473095; h=date:from:to:subject:message-id:references:mime-version: in-reply-to; bh=mS4WjFglcRan2mPmf+OWjW+62beOVa5ED0IMtccfNFc=; b=ARFudAgconueIrZ6kVSl5bcUl07fZjVy4HOY4iocOHagr62wQreOJoMP jeXe1b2dNdtqA9CjU6BOM7HwnJ35J0TQBZbH1vakG93D/6Fx+neUMa4Hj VCgGBxos+XPm01k1v74O8l/oQs5W/TABRqUO/jJwqX+brZS520dO5vGti M=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwEAOskZ1AKXgZQ/2dsb2JhbABFvziCIAEBBTpPCxgeEBQpIBOICbl1ix+DK4JAYAOVaAGQK4JpghU Date: Sat, 29 Sep 2012 18:44:51 +0200 From: Thomas Bach To: Subject: Re: Slicing iterables in sub-generators without loosing elements References: <7xpq54u76v.fsf@ruckus.brouhaha.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <7xpq54u76v.fsf@ruckus.brouhaha.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [94.219.181.175] 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: 1348937097 news.xs4all.nl 6871 [2001:888:2000:d::a6]:46711 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30507 On Sat, Sep 29, 2012 at 09:26:00AM -0700, Paul Rubin wrote: > Thomas Bach writes: > > itertools.groupby(data, lambda (x,y) : x) > > is basically what you want. True! Thanks, Thomas Bach