On 2/26/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > Travis Oliphant wrote: > > > If they can't do it easily, then they don't have to define the > > release-function and Python will never call it. > > The case I'm worried about is where the data can move, > so it really *needs* to be locked, yet the object has > no way of ensuring that. It would be impossible for > the object to correctly implement this kind of buffer > protocol.
Are you aware of an object that has such a requirement? I would think that the object is in charge of moving its own buffer. If it doesn't have control over when the buffer moves it shouldn't claim to implement the buffer protocol. > > If you want shape information you are going to have to allocate memory. > > But only when the shape changes, not every time you > want a pointer to the memory. > > I like Guido's idea of separating the shape/type info > from getting the memory pointer. Well it's not my area of expertise. I thought that in order to describe a generalized 3d slice of a 3d array you might need offsets for at least some of the dimensions, but I could be wrong. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
