iterator wrapper

alf ask at me
Fri Aug 11 19:46:16 EDT 2006


Simon Forman wrote:

>>>>>class LW(object): # ListWrapper
>>...     def __init__(self, i):
>>...         self.theiter = i
>>...     def next(self):
>>...         return [self.theiter.next()]


I hoped one lamda would take care of it but looks like it is a simplest 
choice.

> |>> I = ([n] for n in i)

This is nice but I am iterating thru hude objects (like MBs) so you know ...


Thx for responding ...


A.



More information about the Python-list mailing list