[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

Mark Dickinson report at bugs.python.org
Thu Jan 6 10:20:30 CET 2011


Mark Dickinson <dickinsm at gmail.com> added the comment:

[Nick]
> For point 2, it must be the same pointer. When the PEP says "the same", > I agree it could be taken as ambiguous, but the later reference to the 
> exporter managing a linked-list of exported views makes it clear that 
> identity is what matters.

Okay, thanks.  Next point of confusion:  does that mean that in the example I gave, the object 'n' (the memoryview slice) needs to know about *two* distinct Py_buffer structs---one to pass back to releasebuffer and one to store its own information?  It seems to me that these can't be the same, since (a) the Py_buffer for the slice will have different shape and stride from that returned by getbuffer, (b) what's passed back to releasebuffer should be identical to what came from getbuffer, so we can't just modify the shape and stride information in place.

----------

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


More information about the Python-bugs-list mailing list