Hi all,
If I create foo.pyx with the following contents:
cpdef object foo():
cdef unsigned char[:] s = "012345"
return s
I notice the following behavior:
$ python -c '
import foo
m=foo.foo()
print repr(memoryview(m.base).tobytes())
print repr(memoryview(m).tobytes())
'
'012345'
'123450'
On 01/27/2015 05:38 PM, Richard Hansen wrote:
> Hi all,
>
> If I create foo.pyx with the following contents:
>
> cpdef object foo():
> cdef unsigned char[:] s = "012345"
> return s
>
> I notice the following behavior:
>
> $ python -c '
&g
On 01/29/2015 05:14 AM, Richard Hansen wrote:
> On 01/27/2015 05:38 PM, Richard Hansen wrote:
>> Hi all,
>>
>> If I create foo.pyx with the following contents:
>>
>> cpdef object foo():
>> cdef unsigned char[:] s = "012345"
>> return
This patch is a very rough attempt at adding support for read-only
buffer objects to typed memoryviews. It is incomplete, has bugs, and
is very dirty. I'm positing it anyway to solicit help in figuring out
the right way to add read-only buffer support. The 'XXX' comments
mark issues I'm not sure