[Python-3000] Delayed reference counting idea

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Sep 19 07:20:00 CEST 2006


Raymond Hettinger wrote:

> * An easier C API would significantly benefit the language in terms of
> more extensions being available and in terms of increased reliability
> for those extensions.  The current refcount scheme results in pervasive
> refleak bugs and subsequent, interminable bughunts.

It's not clear that a different scheme would be much
different, though. If it's not refcounting, there will
be some other set of rules that must be followed, with
equally obscure bugs if you slip up.

Also, at least half of the boilerplate is due to the
necessity of checking for errors at each step. A
different GC scheme wouldn't help with that.

IMO the only way to make writing C extensions truly
straightforward and non-error-prone is to use some
kind of code generation tool like Pyrex. And then
it doesn't matter how complicated the rules are.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+


More information about the Python-3000 mailing list