Jørgen P. Tjernø wrote:
> I declare the class before SessionStruct, but it also inherits from 
> SessionStruct -- so I guess this is confusing Cython? Is there a 
> workaround? Is this the "wrong" way to do it? :)
If I forward declare SessionStruct _before_ I forward declare the 
classes inheriting from SessionStruct (without referring to the 
inheritance in the forward declaration), it orders the code correctly.

That is, this works:
  cdef class SessionStruct
  cdef class Album

  cdef class SessionStruct:
    cdef Album foo(self):
        pass

  cdef class Album(SessionStruct):
    pass


But this does not (that is, it generates C code, but the C code doesn't 
build):
  cdef class Album

  cdef class SessionStruct:
    cdef Album foo(self):
        pass

  cdef class Album(SessionStruct):
    pass


-- 
Kindest regards, Jørgen P. Tjernø
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to