Joachim Saul, 24.11.2009 20:59:
> in Pyrex I do
> 
> cdef extern from "Python.h":
>      ctypedef class __builtin__.str  [object PyStringObject]:
>          pass
> 
> cdef extern void c_foo(char*)
> 
> def foo(str bar=""):
>      c_foo(bar)
> 
> This is works nicely in Pyrex (as long as normal text strings are 
> passed, *not* with binary data *containing* 0-bytes, of course).

You should read this:

http://wiki.cython.org/FAQ#HowdoIpassaPythonstringparameterontoaClibrary.3F

Stefan

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

Reply via email to