[Cython] Compiler crash: forward declaration of cdef class with "public" attributes

Alok Singhal gandalf013 at gmail.com
Wed Jul 23 09:29:50 CEST 2014


On Tue, Jul 22, 2014 at 11:42 PM, Robert Bradshaw <robertwb at gmail.com> wrote:
> On Tue, Jul 8, 2014 at 4:34 PM, Alok Singhal <gandalf013 at gmail.com> wrote:
>
> Thanks. https://github.com/cython/cython/commit/967c8e11da94ddae1ea7f1524f6beef2e030c4d9

Thanks for the fix!

> FWIW, forward declarations should not generally be needed, and
> certainly not needed if the class is already declared in a pxd file.

I encountered this problem because we have a tool that generates .pxd
files automatically from a .pyx file, and that tool ends up generating
code like this in certain cases.

Also, if forward declarations are not recommended, what is the best
way to declare two cdef classes that need to know about each other?
(Short of "don't do that!" :-) ).

Thanks,
Alok


More information about the cython-devel mailing list