[IronPython] How to get the list of objects created

Curt Hagenlocher curt at hagenlocher.org
Wed Sep 15 18:24:32 CEST 2004


thane at magna-capital.com writes

> ** BUG  ALERT  **
> But if you try to get the values() of the global dictionary in
> IronPython, it will crash.
> 
> C:\Python\IRONPY~1.6\bin>ironpythonconsole
> >>> X = 4
> >>> Y = 6
> >>> globals()
> {'X':4, 'Y':6}
> >>> g.values()
> 
> Fatal stack overflow error.

Interesting.  It looks like the problem is that the result of the
previous call to global() is itself being saved into the global
namespace, as the '_' value.  When you next reference globals,
you get a recursive structure.

This likely wouldn't be an issue if run from inside a .py file
that was started at the command line -- it's just a side effect
of the interactive mode.

--
Curt Hagenlocher
curt at hagenlocher.org



More information about the Ironpython-users mailing list