cdef extern from "Python.h":
object PyString_FromStringAndSize(char *, int)cdef char buf[42]
my_string = PyString_FromStringAndSize(buf, 42)
cdef extern from "Numeric/arrayobject.h":struct PyArray_Descr:
int type_num, elsize
char typectypedef class Numeric.ArrayType [object PyArrayObject]:
cdef char *data
cdef int nd
cdef int *dimensions,*strides
cdef object base
cdef PyArray_Descr *descr
cdef int flags
For more information about external extension types, see the"External Extension Types"section of the"Extension Types" documentationpage.
cdef class Vegetables:Also see the"Attributes"section of the"ExtensionTypes" documentation page.
cdef int rhubarb
...
cdef Vegetables veg
veg.rhubarb = 42