empty lists vs empty generators

Jeremy Bowers jerf at jerf.org
Wed May 4 14:29:23 EDT 2005


On Wed, 04 May 2005 13:45:00 +0000, Leif K-Brooks wrote:

> Jeremy Bowers wrote:
>>     def __init__(self, generator):
>>         self.generator = generator
> 
> You'll want to use iter(generator) there in order to handle reiterables.

Can you expand that explanation a bit? I'm not certain what you mean. I'm
just trusting what the user passes in; maybe the user should pass it
iter(generator) when it's a "reiterable"? (Honest question.) 

What definition of "re-iterable" are you using? (A quick google for
"Python reiterabile" just turns up some Python dev list entries from 2003.)




More information about the Python-list mailing list