extending the builtin array class from C
joachim at ee.ucla.edu
Sat Aug 14 23:32:51 CEST 2004
I would like to inherit the builtin array class and write som extension
methods in C. Other people have suggested that I use numarray for that,
but all I want is a simple continuous C array of doubles, and a way to
access the array directly from some C extension methods.
I thought it would be possible to change the "xxsubtype.c" to accomodate
my needs, but when it comes to actually defining the "array" class I am
a bit lost. There are no header files, so how do I define the "array type?
The init method for the spamdict type of xxsubtype.c module looks
static int spamdict_init(spamdictobject *self, PyObject *args, PyObject
if (PyDict_Type.tp_init((PyObject *)self, args, kwds) < 0)
self->state = 0;
How would I replace the PyDict_Type with an array type? Or is it not
possible to extend all builtin classes from C?
More information about the Python-list