Robert Dailey wrote:

When I do:

for key in stuff.keys():


It works! I wonder why .keys() makes a difference. It is using a
'view', which is a new concept in Python 3.0 that I'm not totally
familiar with yet.

Because stuff.keys() is evaluated *once* and the result is a separate object from stuff == globals(), so creating the new entry 'key' in globals == stuff does not change that new object.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to