[Python-Dev] Re: Candidate Itertools
David Abrahams
dave at boost-consulting.com
Thu Jun 24 07:36:05 EDT 2004
Aahz <aahz at pythoncraft.com> writes:
>> def pairswap(iterable):
>> return ((b,a) for a,b in iterable)
>
> -1 -- too trivial.
Yeah, shouldn't any sequence-returning functions in itertools really
be returning an iterator adaptor? After all, what if iterable is
reading from a file?
What we need is a lazy views library.
--
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com
More information about the Python-Dev
mailing list