Hi,

Lisandro Dalcin wrote:
> Stefan, many, many thanks for your explanations. I believe I've
> started to understand the whole beast. Please clarify me this:
> 
> Suppose I write this method in a pyx file:
> 
> def foo(char value[]): pass
> 
> and next call it (in a Py3 runtime env) in this two ways:
> 
> 1-  foo(b"abc")
> 
> 2-  foo("abc")
> 
> then (1) should be just fine, Cython should pass the raw C data as it
> comes. But in the case of (2), will/should Cython (or at the Python C
> API level) generate an error?

Yes, you will get a TypeError for (2). The Python3 equivalent is this:

    def foo(value): value = bytes(value)

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

Reply via email to