On 28.02.2013 15:55, Dave Hirschfeld wrote:

So the issue is that at present memoryviews can't be readonly?

https://github.com/cython/cython/blob/master/Cython/Compiler/MemoryView.py#L33

Typed memoryviews are thus acquired with the PyBUF_WRITEABLE flag. If the the assigned buffer is readonly, the request to acquire the PEP3118 buffer will fail.

If you remove the PyBUF_WRITEABLE flag from lines 33 to 36, you can acquire a readonly buffer with typed memoryviews. But this is not recommended. In this case you would have to check for the readonly flag yourself and make sure you don't write to readonly buffer.


Sturla


_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to