Christian Heimes <li...@cheimes.de> added the comment:

A consumer will use the APIs:

---
Py_buffer *view;
int ndim;
const char *format;
const Py_ssize_t *shape, *strides, *suboffsets;
void *buf;

view = PyBuffer_New();
PyObject_GetBuffer(obj, view, flags);
ndim = PyBuffer_GetLayout(&format, &shape, &strides, &suboffsets);
buf = PyBuffer_GetPointer(view, [...]);
PyBuffer_Free(view); // also calls PyBuffer_Release()
---


The API functions PyBuffer_FillInfo(), PyBuffer_FillInfoEx(), and 
PyBuffer_GetInternal() are for exporters (producers)-only. The exporter uses 
the PyBuffer_FillInfo*() in its Py_bf_getbuffer function to fill the view. It 
may use PyBuffer_GetInternal() in its Py_bf_releasebuffer function to access 
the internal field and to release additional resources.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45459>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to