Author pitrou
Recipients ncoghlan, pitrou, rupole
Date 2010-11-02.22:34:57
SpamBayes Score 2.28636e-06
Marked as misclassified No
Message-id <1288737292.3541.5.camel@localhost.localdomain>
In-reply-to <1288737004.38.0.369323365897.issue10181@psf.upfronthosting.co.za>
Content
> As far as I know, PEP 3118 serves its purpose of allowing extension
> modules like numpy and PIL to share data without needing to copy it
> around all the time. It's just that memoryview wasn't really part of
> that purpose (since all the affected third party libraries have their
> own objects for looking at memory), and it shows :P

The deeper issue is that there are no ownership or lifetime rules for
dynamically allocated fields in Py_buffer (such as strides and shape),
which itself isn't a PyObject. For very simple objects (such as bytes or
bytearray) it isn't really a problem, but it is in more complicated
situations; and there's no possible solution without a clear spec..

(and I'm not even talking of the issue of making slices of memoryviews,
since the buffer API itself doesn't handle slicing, which means the
memoryview object has to modify its inner Py_buffer...)
History
Date User Action Args
2010-11-02 22:34:59pitrousetrecipients: + pitrou, ncoghlan, rupole
2010-11-02 22:34:57pitroulinkissue10181 messages
2010-11-02 22:34:57pitroucreate