[Python-Dev] Allocation of shape and strides fields in Py_buffer (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Thu Dec 11 01:35:05 CET 2008
- Previous message: [Python-Dev] Allocation of shape and strides fields in Py_buffer
- Next message: [Python-Dev] Allocation of shape and strides fields in Py_buffer
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Greg Ewing <greg.ewing canterbury.ac.nz> writes:
This was a deliberate decision -- in fact I argued for it myself. The buffer interface is meant to be a minimal-overhead way for C code to get at the underlying data. Requiring allocation of a PyObject would be too expensive.
Tuples are used everywhere throughout the interpreter and yet they are proper PyObjects. Even simple integers are often wrapped into PyLong objects (see the getitem/setitem protocol in Py3k). I doubt Py_buffers are more critical for performance than tuples and integers are.
- Previous message: [Python-Dev] Allocation of shape and strides fields in Py_buffer
- Next message: [Python-Dev] Allocation of shape and strides fields in Py_buffer
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]