On 27.02.2013 20:05, Dave Hirschfeld wrote:

Is this a required restriction? Is there any workaround?



http://www.python.org/dev/peps/pep-3118/

What you should consider is the "readonly" field in "struct bufferinfo" or the access flag "PyBUF_WRITEABLE".

In short:

A PEP3118 buffer can be readonly, and then you shouldn't write to it! When you set the readonly flag, Cython cannot retrieve the buffer with PyBUF_WRITEABLE. Thus, Cython helps you not to shoot yourself in the foot. I don't think you can declare a read-only memoryview in Cython. (Well, not by any means I know of.)


Sturla



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

Reply via email to