[issue22003] BytesIO copy-on-write

David Wilson report at bugs.python.org
Fri Jul 18 09:12:03 CEST 2014


David Wilson added the comment:

Good catch :( There doesn't seem to be way a to ask for an immutable buffer, so perhaps it could just be a little more selective. I think the majority of use cases would still be covered if the sharing behaviour was restricted only to BytesType.

In that case "Py_buffer initialdata" could become a PyObject*, saving a small amount of memory, and allowing reuse of the struct member if BytesIO was also modified to directly write into a private BytesObject

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22003>
_______________________________________


More information about the Python-bugs-list mailing list