[Paul Rubin]
> 1. File iterator for blocks of chars:
>
>        f = open('foo')
>        for block in f.iterchars(n=1024):  ...

for block in iter(partial(f.read, 1024), ''): ...



> iterates through 1024-character blocks from the file.  The default iterator
>       a) def flip(f): return lambda x,y: f(y,x)

Curious resemblance to:

   itemgetter(1,0)


Raymond



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to