Antoine Pitrou <pit...@free.fr> added the comment: > - For each buffer yielded by `bf_getbuffer`, `bf_releasebuffer` > is called exactly once. > > Each `bf_releasebuffer` call is guaranteed to get the same > view->internal pointer as filled in previously by the > corresponding `bf_getbuffer`. > > All other fields in `Py_buffer` may be modified by the consumer, > and `bf_releasebuffer` may not assume they contain valid data. > > - The exporter of the buffer must ensure that apart from the contents > of the memory pointed to by `buf`, the contents of the returned > Py_buffer (format, strides, shape, etc.) remain unchanged.
Yes! Can you write a patch that does these docs changes and also fixes the internal pointer issue? > What about the more strict requirement: > > - `bf_releasebuffer` is guaranteed that all fields except `obj` > are not modified? Well, if you manage to change the memoryview implementation for that, then fine. But I don't know how you plan to manage ownership of fields such as strides and friends. > BTW, should I take this discussion to Python-dev? So far, I kept it > here, as this bug report seemed to be about general issues in the > current implementation and spec. I don't think you need to. Nick and Mark follow this issue (and so does Travis if he's still alive ;)). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10181> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com