This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Implement PyObject_GetMemoryView
Type: enhancement Stage:
Components: C API Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: nanjekyejoannah, skrah
Priority: normal Keywords:

Created on 2020-03-03 15:18 by nanjekyejoannah, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg363265 - (view) Author: Joannah Nanjekye (nanjekyejoannah) * (Python committer) Date: 2020-03-03 15:18
We have a memory-view object represented with the following structure:

typedef struct {
    PyObject_VAR_HEAD
    _PyManagedBufferObject *mbuf; /* managed buffer */
    Py_hash_t hash;               /* hash value for read-only views */
    int flags;                    /* state flags */
    Py_ssize_t exports;           /* number of buffer re-exports */
    Py_buffer view;               /* private copy of the exporter's view */
    PyObject *weakreflist;
    Py_ssize_t ob_array[1];       /* shape, strides, suboffsets */
} PyMemoryViewObject;

It would be good to have the implementation for PyObject_GetMemoryView which returns a memory-view object as was originally intended in PEP 3118 i.e :

PyObject *PyObject_GetMemoryView(PyObject *obj)
History
Date User Action Args
2022-04-11 14:59:27adminsetgithub: 84017
2020-03-03 15:20:30vstinnersetnosy: + skrah
2020-03-03 15:18:37nanjekyejoannahcreate