>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...

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!
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to