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 | ncoghlan at gmail.com | Brisbane, Australia ---------------------------------------------------------------
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4