Re: extending Python base class in C

2005-06-15 Thread harold fellermann
Yah! Finally, I got the thing to work. Here is how I did it. /* import the module that holds the base class */ PyObject *base_module = PyImport_ImportModule("module_name"); if (!base_module) return; /* get a pointer to the base class */ PyObject *base_class = PyMapping_GetItemString(

Re: extending Python base class in C

2005-06-14 Thread Scott David Daniels
harold fellermann wrote: > ... > This gives me a pointer to the class I want to use as base class. > Does anyone know how to assign this to the extension class? I tried > to build a tuple (BaseClass,) and assign it (after the respective > PyType_Ready call) ... I think this is your problem -- call

Re: extending Python base class in C

2005-06-14 Thread harold fellermann
> "harold fellermann" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > Hi all, > > I once read that it is possible to use a python base class for a C > extension class. On 14.06.2005, at 09:29, Grigoris Tsolakidis wrote: > There was good article of how to do this on DDJ home page

Re: extending Python base class in C

2005-06-14 Thread Grigoris Tsolakidis
There was good article of how to do this on DDJ home page www.ddj.com "harold fellermann" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi all, I once read that it is possible to use a python base class for a C extension class. To be precise, I want to achieve the following behavior