Tiger12506 wrote: > Hehehe, did you try it Kent?
Obviously not :-) > Which is not what I expected! > Until I realized that you are missing the % sign in between the print string > and the tuple of values to interpolate Blame that one on Michael, I copied from him :-) > Then it returns this: > varname: __builtins__ type: <type 'module'> > > Traceback (most recent call last): > File "C:\Documents and Settings\Jacob\Desktop\diction.py", line 1, in > <module> > for name, value in locals().iteritems(): > RuntimeError: dictionary changed size during iteration > > The .copy() is necessary. Ok. Or use locals().items() which implicitly copies by making a list of key, value pairs. Though I suspect a robust solution will involve inspecting the stack frame passed to a sys.settrace() callback, not looking at locals() directly... Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor