dict.items() vs dict.iteritems and similar questions

Duncan Booth duncan.booth at invalid.invalid
Thu Mar 15 17:23:48 EDT 2007


Marc 'BlackJack' Rintsch <bj_666 at gmx.net> wrote:

> In <mailman.5140.1173979852.32031.python-list at python.org>, skip wrote:
> 
>> Are you sure?  There's no guarantee that an iterator will terminate:
>> 
>>     len(list(itertools.cycle(range(10))))
> 
> You have infinite memory?  ;-)

Strangely, Skip's example is exactly the one I tested before posting my 
claim that it would terminate.



More information about the Python-list mailing list