[ANNOUNCE] Garbage collection for Python

Greg Ewing greg at cosc.canterbury.ac.nz
Wed Apr 12 21:40:42 EDT 2000


Tim Peters wrote:
> 
> See Py_NewInterpreter() in the
> "Initialization, Finalization, and Threads" section of the Python/C API
> manual.  There isn't a Python-level interface to this yet;

That's an intriguing idea! There's been a notion in the back
of my mind that a Python IDE, such as IDLE, should be able to
run the program under development in a separate Python
environment, with its own global module list, etc., so that
you can cleanly throw it all away and restart without any
hassles over reloading changed modules, etc.

This could be quite easy to do if there were a Python
function for creating a new Python interpreter!

One thing that might get a bit hairy is that, for debugging,
code running in the first-level interpreter would need to
be able to access objects belonging to the second-level
interpreter. Would this sharing of objects between
interpreters lead to anything bad happening?

The other thing is what to do about extension modules.
Ideally it should be possible to load multiple "instances"
of an extension module into different interpreters, and
there should be a way of finalising one of these instances
when the interpreter it belongs to goes away. I don't think
that's possible at the moment, because extension modules
don't have any finalisation entry point.

-- 
Greg Ewing, Computer Science Dept,
+--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+



More information about the Python-list mailing list