A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-December/084160.html below:

[Python-Dev] Allocation of shape and strides fields in Py_buffer

[Python-Dev] Allocation of shape and strides fields in Py_buffer [Python-Dev] Allocation of shape and strides fields in Py_bufferNick Coghlan ncoghlan at gmail.com
Tue Dec 9 10:07:53 CET 2008
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
---------------------------------------------------------------
More information about the Python-Dev mailing list

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