Antoine Pitrou wrote: > Nick Coghlan <ncoghlan <at> gmail.com> writes: >> No, you misunderstand what I meant. Py_buffer doesn't need to be changed >> at all. The *issuing type* would define a new structure with the >> additional fields, such as: > > With to the current buffer API, this is not possible. It's the caller who > allocates the Py_buffer struct (usually on the stack), not the callee. > Therefore > the callee (e.g. the getbufferproc of the issuing type) cannot choose to > allocate a different structure. > > (of course complex schemes can be devised where the callee maintains its own > separate storage for shape and strides, but I don't think we want to go there)
In that case, as Greg noted, this is exactly what the callee should be doing. Maintaining a PyDict instance to map from view pointers to shapes and strides info doesn't strike me as a "complex scheme" though. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com