Writting extension classes with PythonC

Alex Martelli aleaxit at yahoo.com
Sat Sep 16 00:04:20 CEST 2000


"Rainer Deyke" <root at rainerdeyke.com> wrote in message
news:u%uw5.164028$6y5.101528790 at news2.rdc2.tx.home.com...
> "kFactor" <kfactor at my-deja.com> wrote in message
> news:8ptqph$dqt$1 at nnrp1.deja.com...
> > Hi all
> >
> > I recently made a simple C extension type based on "PyTypeObject" but I
> > get a "TypeError: base is not a class object" when I try to derive a
> > new class from it, and I think I read somewhere that the C API does not
> > allow the creation of new classes. Is this true ?
> >
> > Has anyone succeded in creating pure python classes (i.e. that can be
> > used as base classes) with the C API ?
>
> Not without PyRun_SimpleString or similar. :-)

The ExtensionClass extension, developed as a part of Zope, is one
of the ways this can be achieved.  If I recall correctly, it's now also
packaged (downloadable and installable) separately from Zope;
I'm pretty sure this was announced on this group within the
last month.


Alex






More information about the Python-list mailing list