【发布时间】:2021-12-17 14:25:25
【问题描述】:
我需要一个使用 Cython 扩展类型的链表,即。 cdef class 但 Cython 编译器抱怨 Python 对象。
cdef class Item:
cdef Item* prev
cdef Item* next
Cython 错误:Pointer base type cannot be a Python object
应该是cdef struct,但是使用cdef class 有什么解决方法吗? (因为我需要方法和 OOP 约定)
【问题讨论】:
标签: python class pointers struct cython