Martin Panter added the comment: Issue 11427 has some discussion about this. It seems one concern was to make it hard to modify the buffer of a bytes object (which is supposed to be immutable). But I agree there should be an easy way to access read-only buffers in ctypes. Perhaps that could be by relaxing from_buffer(), or perhaps by some safer or more explicit API.
See also Issue 11429, complaining about scattered support of writable buffers elsewhere, and using bytes objects with an offset. ---------- nosy: +martin.panter versions: +Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28646> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com