Robert Bradshaw wrote: > I've thought about this some more, and the amount of casting it would > take to get the C compiler to not complain when trying to treat > unsigned char* as strings, I actually don't think it's any natural to > convert strings to unsigned char*, so the double cast above seems > like the right thing to do
Regarding the "natural" bit, libxml2 actually defines all its UTF-8 encoded byte strings as "unsigned char*". So, except for serialised XML, basically every string you get from libxml2 uses that. This is so inconvenient to work with in Cython that the original author of lxml actually went for the simple 'solution' of declaring everything as plain char* and passing "-w" to gcc (which is still in use today, although it already bit me more than once). I don't think there's anything wrong with letting Cython do the necessary casting under the hood. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
