Paul Rubin wrote:
> alf <[EMAIL PROTECTED]> writes:
> 
>>>|>> I = ([n] for n in i)
>>
>>This is nice but I am iterating thru hude objects (like MBs) so you know ...
> 
> 
> I don't understand the objection-- the above is entirely correct and
> produces the same iterator you'd get from
> 
>     def wrap(i):
>        for x in i:
>            yield [x]
>     I = wrap(i)
> 
> You could also use
>  
>    import itertools
>    I = itertools.imap(lambda x: [x], i)
> 
> which again does the same thing.


I did see [] instead of () :-). this was a source of confusion.


okay, we have 3 functionally equal solution - which is most pythonic :-) 
.... seroiusly ...



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

Reply via email to