[Python-Dev] Re: A cute new way to get an infinite loop

Delaney, Timothy C (Timothy) tdelaney at avaya.com
Fri Sep 24 03:17:06 CEST 2004


Terry Reedy wrote:

> So, are things like this a programming bug, interpreter bug, or
> language definition bug?  or just a 'gotcha'?

Gotcha. In pretty much every language, you have to be careful about
modifying what you're iterating over. I don't see that Python should be
any different ;)

However, Tim's example is a bit less obvious that you are modifying the
thing you're iterating over ... Hence the "cuteness" IMO.

Tim Delaney


More information about the Python-Dev mailing list