Title: array.array does not support the buffer interface
Type: Stage:
Components: Versions: Python 2.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, ellery.newcomer, skrah
Priority: normal Keywords:

Created on 2012-09-10 21:54 by ellery.newcomer, last changed 2012-09-10 23:23 by benjamin.peterson. This issue is now closed.

File name Uploaded Description Edit
test.c ellery.newcomer, 2012-09-10 21:54 example code calling PyObject_CheckBuffer on an array.array object
Messages (4)
msg170242 - (view) Author: Ellery Newcomer (ellery.newcomer) Date: 2012-09-10 21:54
According to,

array.array supports the buffer interface; however in python 2.7, PyObject_CheckBuffer says this is not the case.

all is well in python 3.2, though.
msg170244 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2012-09-10 22:54
array.array supports the old buffer interface not the new one, which PyObject_CheckBuffer is part of.
msg170247 - (view) Author: Ellery Newcomer (ellery.newcomer) Date: 2012-09-10 23:20
relevant question, then, is why does array not support the new buffer interface while str and bytearray support both old and new?
msg170248 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2012-09-10 23:23
It simply wasn't converted in time for the 2.7 release. The new buffer API is considered something of a technical preview in Python 2.x.
Date User Action Args
2012-09-10 23:23:08benjamin.petersonsetmessages: + msg170248
2012-09-10 23:20:06ellery.newcomersetmessages: + msg170247
2012-09-10 22:54:32benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg170244

resolution: not a bug
2012-09-10 22:00:29vstinnersetnosy: + skrah
2012-09-10 21:54:06ellery.newcomercreate