Cython - 从第二种扩展类型访问扩展类型的c类型成员

时间:2012-09-07 03:51:08

标签: python cython

我有一个包含一些c指针作为成员的扩展类型。我想公开这些成员,以便我可以从不同的扩展类型访问它们。有办法吗?

这基本上是这样的:

typeA.pxd:

cdef class typeA(object):
  cdef double *myArray

typeB.pyx:

cimport typeA
import typeA

cdef class typeB(object):
  typeA.typeA myA
  cdef someFunction(self):
    b = myA.myArray[0]

如何从typeB访问myArray(最好没有python开销)?

0 个答案:

没有答案