Stefan Krah <stefan-use...@bytereef.org> added the comment: [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 <rep...@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(). ---------- _______________________________________ 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