[Pyrex] Bug in CoerceFromPyTypeNode in 0.9.5

Peter Johnson peter at tortall.net
Sun Jan 28 21:52:46 UTC 2007


On Sun, 28 Jan 2007, Peter Johnson wrote:
> cdef extern from *:
>     ctypedef enum foo:
>         FOO
> cdef void func():
>     cdef foo x
>     map = [FOO]
>     x = map[0]

Sorry for all the self-replies, but an explicit cast does indeed fix this:
     x = <foo>map[0]

If the cast is indeed now required due to better type-strictness in 0.9.5, 
maybe all what's really needed here is just to give an informative error 
message rather than crashing.

Thanks,
Peter



More information about the Pyrex mailing list