Re: [Cython] Potential bug: hole in "C <-> Python" conversion

2012-06-29 Thread Stefan Behnel
Stefan Behnel, 29.06.2012 13:07: > Dieter Maurer, 29.06.2012 12:18: >> I need "const unsigned char*" and "const xmlChar *" >> (where "xmlChar" is defined as "unsigned char"). > > Ah, right, libxml2 - an excellent example. lxml is still suffering from the > decision of its initial author to ignore

Re: [Cython] Potential bug: hole in "C <-> Python" conversion

2012-06-29 Thread Stefan Behnel
Dieter Maurer, 29.06.2012 12:18: > Stefan Behnel wrote at 2012-6-29 11:42 +0200: >> Also note that libc.string contains declarations for "const char*" and >> friends. > > Unformatunately Nice word, took me a while to make my brain split the characters correctly. ;) > I need "const unsigned cha

Re: [Cython] Potential bug: hole in "C <-> Python" conversion

2012-06-29 Thread Dieter Maurer
Stefan Behnel wrote at 2012-6-29 11:42 +0200: >Dieter Maurer, 29.06.2012 11:25: >> I have >> >> cdef extern from *: >> ctypedef char const_unsigned_char "const unsigned char" > >This is an incorrect declaration. "char" != "unsigned char". You are right. I cheat to get "Cython" convert betw

Re: [Cython] Potential bug: hole in "C <-> Python" conversion

2012-06-29 Thread Stefan Behnel
Dieter Maurer, 29.06.2012 11:25: > I have > > cdef extern from *: > ctypedef char const_unsigned_char "const unsigned char" This is an incorrect declaration. "char" != "unsigned char". > cdef const_unsigned_char *c_data = data > > leads to "Cannot convert Python object to 'const_unsign

[Cython] Potential bug: hole in "C <-> Python" conversion

2012-06-29 Thread Dieter Maurer
I have cdef extern from *: ctypedef char const_unsigned_char "const unsigned char" cdef const_unsigned_char *c_data = data leads to "Cannot convert Python object to 'const_unsigned_char *'" while "cdef char *c_data = data" works. Should the "ctypedef char const_unsigned_char" not ensure