[Python-Dev] Re: Fatal scoping error from the twilight zone

Guido van Rossum guido@digicool.com
Mon, 12 Feb 2001 11:12:41 -0500


> The problem, fixed in rev. 2.163 of compile.c, was caused by iterating
> over a dictionary using PyDict_Next() and updating it at the same
> time.  The updates are now deferred until the iteration is done.

Ha!  This is excellent anecdotal evidence that "for key in dict", if
we ever introduce it, should disallow updates of the dict while in the
loop!

--Guido van Rossum (home page: http://www.python.org/~guido/)