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).

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

python
>>> 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 <rep...@bugs.python.org>
<http://bugs.python.org/issue17145>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to