Author skrah
Recipients jcon, kermode, mark.dickinson, ncoghlan, petri.lehtinen, pitrou, pv, rupole, skrah, teoliphant, vstinner
Date 2011-07-04.13:00:52
SpamBayes Score 1.00185e-08
Marked as misclassified No
Message-id <1309784454.2.0.501242715317.issue10181@psf.upfronthosting.co.za>
In-reply-to
Content
[I agree that multi-dimensional support should not be part of this
 patch. I was thinking about creating a separate branch for that.]

Nick Coghlan <report@bugs.python.org> wrote:
> As far as the rule of disallowing shape changes while a buffer is exported, 
> I actually think that's a more sane approach as well. However, I've been 
> burned enough times by going "nobody would be insane enough to rely on that, 
> would they?" that I'm seriously reluctant to impose additional backwards 
> incompatible rules on a published spec when it isn't *too* difficult to 
> adjust the infrastructure to better handle the existing complexity.

Yes, I understand. However, Pauli said earlier:

"I don't see many use cases for the same object exporting multiple 
 different buffers. It's not needed by Numpy, and I suspect there is 
 no existing 3rd party code that relies on this (because it doesn't 
 work with the current implementation of memoryview :)"


That's why I thought that no one could be using this feature at present.


The main problem that have with PyManagedBuffer is that the capabilities
of the original underlying buffer (flags) *at the time of the export* 
aren't stored anywhere.

This makes it hard to respond to specific queries in memory_getbuf()
and PyMemoryObject_GetContiguous(). You can't query the original
object again since it might have changed.

I suppose that an existing memoryview could recompute its own
capabilities by using PyBuffer_IsContiguous() and friends. It
would be much easier though if the original flags were stored
in the buffer by PyObject_GetBuffer().
History
Date User Action Args
2011-07-04 13:00:54skrahsetrecipients: + skrah, teoliphant, mark.dickinson, ncoghlan, rupole, kermode, pitrou, vstinner, pv, jcon, petri.lehtinen
2011-07-04 13:00:54skrahsetmessageid: <1309784454.2.0.501242715317.issue10181@psf.upfronthosting.co.za>
2011-07-04 13:00:53skrahlinkissue10181 messages
2011-07-04 13:00:52skrahcreate