[Pyrex] Bug in CoerceFromPyTypeNode in 0.9.5

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jan 30 01:08:38 UTC 2007


Peter Johnson wrote:
> On Mon, 29 Jan 2007, Greg Ewing wrote:
 >
>> Yes, the typecast is needed now, because I've made it use
>> the C++ rules for enum compatibility, which don't allow
>> turning an int into an enum implicitly.
> 
> Actually the typecast generates incorrect C code, as map[0] is a Python 
> object.

True, what I said up there was wrong. For assigning
a *C* int to an enum you need a cast. But for a Python
int, you shouldn't write a cast, and Pyrex should
generate the conversion and cast as needed. I will
fix this.

--
Greg



More information about the Pyrex mailing list