Hello all,

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).

In Cython 0.12, however, this gives the error

        Cannot assign type 'str object' to 'str'

probably because of the default value "". Is this intentional or am I 
overlooking something trivial? Python is version 2.6.2

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

Reply via email to