Stefan Behnel wrote:

>     cdef unicode u = "abcdefg"
>     cdef char* s = u
>     u = None
>     print s
> 
> Now, where's the reference to the string buffer now?

That's the way Pyrex has always handled str -> char* conversions,
and I assume the way Cython still handles bytes -> char*. You
have to keep a reference to the Python object around for as
long as you need the char*.

-- 
Greg
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to