[New-bugs-announce] [issue17145] memoryview(array.array)

Demian Brecht report at bugs.python.org
Wed Feb 6 18:12:34 CET 2013

New submission from Demian Brecht:

array.array doesn't implement the buffer interface in 2.7, so memoryviews cannot be applied to them. As memoryview has been backported to 2.7, array.array should be updated to support it. Either that, or the 2.7 documentation should be updated to reflect the lack of support for arrays in 2.7 (http://docs.python.org/2.7/c-api/buffer.html).

>>> memoryview(array('I', [1,2,3,4]))
<memory at 0x109e46048>

>>> memoryview(array('I', [1,2,3,4]))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: cannot make memory view because object does not have the buffer interface

components: None
messages: 181541
nosy: Demian.Brecht
priority: normal
severity: normal
status: open
title: memoryview(array.array)
type: enhancement
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list