Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!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.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'python3': 0.07; 'subject:would': 0.07; 'feature,': 0.09; 'python': 0.11; 'thread': 0.14; "wouldn't": 0.14; '(assuming': 0.16; 'angle': 0.16; 'bracket': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'iterator': 0.16; 'itertools': 0.16; 'quoted': 0.16; 'simplest': 0.16; 'subject:key': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'thu,': 0.19; 'import': 0.22; 'saying': 0.22; 'effort.': 0.24; 'switch': 0.26; 'this:': 0.26; 'post': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; 'getting': 0.31; 'clicked': 0.31; 'probably': 0.32; 'subject:all': 0.32; 'text': 0.33; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'subject:?': 0.36; 'list': 0.37; 'email addr:python.org': 0.37; 'received:209': 0.37; 'minimum': 0.38; 'to:addr:python-list': 0.38; 'list,': 0.38; 'to:addr:python.org': 0.39; 'mailing': 0.39; 'skip:x 10': 0.40; "you're": 0.61; 'address': 0.63; 'email name :python-list': 0.65; 'reply': 0.66; '20,': 0.68; 'line,': 0.68; 'hey,': 0.75; 'citation': 0.84; 'one).': 0.84; 'subject:Idea': 0.84; 'reply,': 0.93; '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; bh=qkmWvDKtsafWSNFvg2sC22SPErF7khdvrQd7+MmKjxI=; b=dxfPnibeH0jVNa4RJKiEARc1fX9H1tY4m36fSY2ELATu7PFCfY3OoHAT5uwBq58VKN AIvpm8GpgX3IpkM/MljxzLojx+vwPNAnH1OgW0oDYhPmMUs/g6bBkrwmoIX1P8AjQusd SorsqVlde6c58WRWY/J82RJLW3zV3O8vQmyw5h4PYyfP/vFtSVjGVOhF57taaoIEDV1y dehglNV21FoniNYlwiHeD6ZQADECmCsr6tL3TVzrT1VkKsSW9xI2Um72z7C4PQ1erSfD DcRwjRPE5zi4RDDb+4oKSE5IrWQ1gab5e958Yqj/24wO4vfItg4htcQvEjl9pHD3Davc UUbg== MIME-Version: 1.0 X-Received: by 10.52.163.165 with SMTP id yj5mr990037vdb.104.1371659970391; Wed, 19 Jun 2013 09:39:30 -0700 (PDT) In-Reply-To: References: <9150d9b7-e488-4f9f-beff-4a140bcc78f0@googlegroups.com> Date: Thu, 20 Jun 2013 02:39:30 +1000 Subject: Re: Idea for key parameter in all() builting, would it be feasible? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371659978 news.xs4all.nl 16001 [2001:888:2000:d::a6]:40797 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48727 On Thu, Jun 20, 2013 at 2:32 AM, wrote: >>All you need is the iterator version of map(). In Python 3, that's the >>normal map(); in Python 2, use this: > >>>>> from itertools import imap >>>>> all(imap(lambda x: bool(x), xrange(10**9))) >>False > >>It's roughly instant, like you would expect. > >>ChrisA > > This probably isn't the way to post a reply on your own thread (I added an angle bracket to every line above :P) but last time clicked reply to author not knowing that is email. Anyways... If you're getting this via the mailing list, just hit Reply, and then change the To: address to python-list@python.org - that's the simplest (assuming you don't have a Reply To List feature, but you wouldn't be saying the above if you had one). That way, you get a citation line, quoted text is marked, and it's taken a minimum of effort. > Thanks, I like itertools but had no idea imap. Although I did suspect Python3 would have something to say about this just to make me envious :D > > It works like a charm! Awesome! Hey, if you *can* switch to Py3, do try to. It has heaps of improvements, and it has a future. :) ChrisA