Closed
Description
Issue description
This is something that occurred to me when reading the Python docs on memoryview, but not something I have any immediate need for - which is why I've labelled it a "feature idea" rather than a "feature request".
At present, buffer_info
doesn't have any indication of whether the memory should be treated as read-only or read-write. There may be a use case for a class to expose a buffer while not allowing writes to it. It looks like it shouldn't be too hard to add a flag to buffer_info and then add check in pybind11_buffer
to raise a BufferError
if the request has PyBUF_WRITABLE
is set but the exposed buffer is read-only.
Metadata
Metadata
Assignees
Labels
No labels