Why is it not possible to get a Py_buffer from an array object?
问题 The python documentation on array clearly states that the array conforms to the buffer interface. It even suggest not using the buffer_info() method. But when I try to get a Py_Buffer from C/C++ code with PyObject_GetBuffer() or use python's memoryview, I get a failure. For example, in python (I use version 2.7): >>> a = array.array('c') >>> memoryview(a) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: cannot make memory view because object does not have the