Defining enums in Cython code that will be used in the C part of code
问题 I have defined and enum in cython header file api.pxd : ctypedef enum InstructionType: default = 0 end_if = 1 end_loop = 2 backward_jump_here = 4 I also have checked if turning ctypedef to cdef would work (and it didn't). And I want to use value from this enum in __cinit__ method fo some class: from api cimport Instruction, CLinVM, InstructionType # (...) some other classes cdef class EndIf(Noop): def __cinit__(self): self.type = InstructionType.end_if And I get compilation error: self.type =