[Pyrex] [Cython] Python 3

Christian Heimes lists at cheimes.de
Tue Apr 29 11:55:29 CEST 2008


Greg Ewing schrieb:
> About half the posts seemed to be suggesting that there
> should be some kind of automatic coercion from a Python
> unicode string to a char *, but only one even mentioned
> the issue of the memory allocation that this would
> require.
> 
> Has a scheme been settled on that would avoid any of
> these problems? If so, is there somewhere I can go to
> read a clear summary of what's been decided?

FYI:
In Python 3.x the PyUnicode object keeps a default encoded PyString in
its struct. You can use PyUnicode_AsStringAndSize() to get an UTF8
encoded char* from a PyUnicode object without worrying about memory
management.

Christian




More information about the Pyrex mailing list