Stefan Krah added the comment: Thanks. No, I don't think there's an official way to accomplish that, but let's create one. How about a new function that takes the buffer request flags:
PyMemoryView_FromObjectEx(exporter, PyBUF_SIMPLE|PyBUF_WRITABLE) If we can spare a new format code, this could be called directly in PyArg_ParseTuple(), which would give back the memoryview. Otherwise, you get the exporter from PyArg_ParseTuple() and call PyMemoryView_FromObjectEx() manually. If I'm not mistaken, this would save us the intermediate buffer on the stack, and it's more readable. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22896> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com