[Idle-dev] Where are the global and local variables kept?

Kurt B. Kaiser kbk at shore.net
Thu Feb 19 21:50:33 EST 2004

David Pennell <dpennell at guardnet.com> writes:

> When I used he debugger, 90%+ of the variables and messages I got
> weren't anything to do with my program. They were always variables
> from pyshell and IDLE itself. For that reason, I gave up on the
> debugger completely a long time ago. Periodically I've checked it out
> and it still does that. I use stuff in my programs now to debug,
> basically.
> So first, does anyone get anything at all out of the debugger, and if
> so, what and how?

I'd suggest that you upgrade to Python 2.3.3 and try IDLE 1.0.2.  
You should find that the debugger no longer traces though IDLE.
This has been true since IDLEfork was integrated into Python 2.3.1.

> Secondly, is there any kind of fix or workaround already out there
> for this? I am not sure where and how IDLE stores the variables it
> displays with the debugger.

The variables are extracted from the stack frames.  IDLE now has code
to ignore those stack frames associated with IDLE itself.

Python has great introspection.  That, plus print statements, can be a
more efficient way to debug user code.  But there are times when the
debugger is useful, particularly if you don't know what you are
looking for.  The current debugger has persistent breakpoints which
are stored between sessions.  You may also find the stack viewer

Please let me know if you have futher problems.


More information about the IDLE-dev mailing list