Python's garbage collection was Re: Python reliability

Tom Anderson twic at
Thu Oct 13 01:41:39 CEST 2005

On Mon, 10 Oct 2005, it was written:

> Tom Anderson <twic at> writes:
>> Has anyone looked into using a real GC for python? I realise it would 
>> be a lot more complexity in the interpreter itself, but it would be 
>> faster, more reliable, and would reduce the complexity of extensions.
> The next PyPy sprint (this week I think) is going to focus partly on GC.

Good stuff!

>> Hmm. Maybe it wouldn't make extensions easier or more reliable. You'd 
>> still need some way of figuring out which variables in C-land held 
>> pointers to objects; if anything, that might be harder, unless you want 
>> to impose a horrendous JAI-like bondage-and-discipline interface.
> I'm not sure what JAI is (do you mean JNI?)

Yes. Excuse the braino - JAI is Java Advanced Imaging, a component whose 
horribleness exceed even that of JNI, hence the confusion.

> but you might look at how Emacs Lisp does it.  You have to call a macro 
> to protect intermediate heap results in C functions from GC'd, so it's 
> possible to make errors, but it cleans up after itself and is generally 
> less fraught with hazards than Python's method is.

That makes a lot of sense.


That's no moon!

More information about the Python-list mailing list