[Pyrex] Subclassing Numeric arrays

George Sakkis gsakkis at eden.rutgers.edu
Sun May 8 21:00:55 CEST 2005


Hi all,

I want to use Pyrex for making a custom extension of  Numeric arrays, but
I don't know how. I tried the simplest possible subclass example but it
seg faults; apparently it doesn't do what I thought it does:

cdef extern from "Numeric/arrayobject.h":
    ctypedef class Numeric.ArrayType [object PyArrayObject]:
        pass

cdef class MyVector(ArrayType):
    pass

# seg fauls
v = Vector((1,2))


Can anyone show the simplest working subclass of PyArrayObject ?

Thanks,
George





More information about the Pyrex mailing list