[Python-Dev] Python 2.3a1's mandatory use of cyclic GC causes
existing applications to fail
Guido van Rossum
guido@python.org
Fri, 07 Feb 2003 07:42:27 -0500
> > > Alternatively, to GC or not GC could be driven by
> > > inheritance. I used that in my flextype implementation.
> > > When a class inherits from no GC-ed anchestors only,
> > > it doesn't install GC as well.
> >
> > That's a fine idea. It would require that there were two standard
> > base classes: object and gcobject. Or better, object and nogcobject;
> > I think that GC should still be the default for classes that have any
> > instance variables at all.
>
> Could metaclasses be used instead of inheritance? It's just that I feel
> quite uncomfortable already with the `inheritance from an object', and
> now if there'll be two root objects...
I'd be more uncomfortable with with more use of metaclasses.
> What would be the relationship between these two objects? Is a
> gcobject an object, or are they both subclasses of an archobject?
object (with GC) would be a subclass of nogcobject (the real root
root).
At the C level, PyBaseObject_Type would become nogcobject and a new
name would be chosen for object, maybe PyGCObject_Type.
--Guido van Rossum (home page: http://www.python.org/~guido/)