On 3.3.2014. 2:27, Ian Kelly wrote:

Python 3.3 has a C API function to create a memoryview for a char*,
that can be made read-only.

     http://docs.python.org/3/c-api/memoryview.html#PyMemoryView_FromMemory

Yes, this is probably what I'll do in absence of pure Python solution. Thanks for the tip.

Or you could bite the bullet and copy everything
once at the start to create a bytes object, and then never have to
worry about it again.

That would be a surrender :-)

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to