what should __iter__ return?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Wed Sep 8 23:59:56 CEST 2010


On Wed, 08 Sep 2010 16:17:02 -0400, Terry Reedy wrote:

> On 9/7/2010 9:40 PM, Gregory Ewing wrote:
>> Thomas Jollans wrote:
>>
>>> Hmm. Modifying an object while iterating over it isn't a great idea,
>>> ever:
>>
>> I wouldn't say never.
> 
> How about "Modifying a collection while iterating over it without
> understanding the dangers is a bad idea."

"... unless you're being paid by the hour for debugging your code."

*wink*



-- 
Steven



More information about the Python-list mailing list