Nick Coghlan <ncogh...@gmail.com> added the comment:

If it helps, one way to think of it is that post-redesign, the PyManagedBuffer 
would be the "real" API object, with Py_buffer merely a way for data exporters 
to provide the information needed to initialise the managed buffer properly. 
(That actually fairly accurately tracks the origin of the Py_buffer struct - to 
avoid huge numbers of output variables in the GetBuffer API calls)

Is such a solution ideal? No, but it would be significantly better than what we 
have now. If the PEP had been implemented as written, we would also have been 
much better off, but given that we failed to pick up the discrepancies between 
spec and implementation at the time, we're now stuck with trying to improve the 
situation without breaking backwards compatibility.

Since I now agree with your diagnosis that the heart of the problem is the fact 
that Py_buffer contains lots of pointers and thus is difficult to copy safely, 
wrapping it in a PyObject (without adding any additional behaviour) in order to 
minimise copying seems like the most obvious solution.

----------

_______________________________________
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

Reply via email to