I converted the Python class to an extension type inside the .pyx file. I can create this object in another Cython module, but I cannot do static printing with it.
Here is part of my class:
cdef class PatternTree: cdef public PatternTree previous cdef public PatternTree next cdef public PatternTree parent cdef public list children cdef public int type cdef public unicode name cdef public dict attributes cdef public list categories cdef public unicode output def __init__(self, name, parent=None, nodeType=XML):
I tried to use the .pxd file to declare it, but it says that the "C method [some function] is declared but not defined" for all my functions. I also tried to strip the C stuff in the functions of my implementation to make it act like an extended class, but that didn't work either.
Here is my .pxd:
cdef class PatternTree: cdef public PatternTree previous cdef public PatternTree next cdef public PatternTree parent cdef public list children cdef public int type cdef public unicode name cdef public dict attributes cdef public list categories cdef public unicode output # Functions cpdef int isExpressions(self) cpdef MatchResult isMatch(self, PatternTree other)
Thank you for your help!
python cython
Spen-zar
source share