cython inheritance

后端 未结 1 1253
遥遥无期
遥遥无期 2021-01-18 13:18

I have a A.pxd (with just declaration of functions) and A.pyx that contains just a class A with all the function body.

Than I have B that inherits from A,

a

相关标签:
1条回答
  • 2021-01-18 13:53

    Use

    from A cimport Aclass
    cdef class Bclass(Aclass):
        # ...
    

    or

    cimport A
    cdef class Bclass(A.Aclass):
        # ...
    

    Note that Aclass must be cdef'fed class, Cython extension types cannot inherit from Python classes.

    0 讨论(0)
提交回复
热议问题