[Python-3000] Builtin iterator type

George Sakkis gsakkis at rutgers.edu
Tue Nov 14 16:26:03 CET 2006


On 11/14/06, Aahz <aahz at pythoncraft.com> wrote:

> [off-list to avoid more CLUTTER]

Sorry, I don't consider a well-intentioned discussion to understand
how things work at the design level of python CLUTTER.

> On Mon, Nov 13, 2006, George Sakkis wrote:
> >
> > Excuse my ignorance, but what's a "self-iter" ?
>
> Files

# iterate over the first 10 lines of two files
f1, f2 = map(Iter, (open('foo.txt'), open('bar.txt'))
for line in f1[:10] + f2[:10]:
    print line,


Pretty pythonic if you ask me.

George


More information about the Python-3000 mailing list