[Cython] bug in typed memoryviews (memoryviewslice)

2015-01-27 Thread Richard Hansen
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'

Re: [Cython] bug in typed memoryviews (memoryviewslice)

2015-01-29 Thread Richard Hansen
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

Re: [Cython] bug in typed memoryviews (memoryviewslice)

2015-01-29 Thread Richard Hansen
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

[Cython] [RFC PATCH] add read-only buffer support to typed memoryviews

2015-02-01 Thread Richard Hansen
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