[New-bugs-announce] [issue34905] Cannot assign memoryview values from array.array

Andrey Paramonov report at bugs.python.org
Fri Oct 5 08:24:52 EDT 2018


New submission from Andrey Paramonov <paramon at acdlabs.ru>:

Currently, memoryview values can be assigned from all bytes-like objects (https://docs.python.org/3/glossary.html#term-bytes-like-object) except byte array.array:

----
import array

mview = memoryview(bytearray(b'hello'))

mview[:] = bytes(b'hello')  # success
mview[:] = bytearray(b'hello')  # success
mview[:] = memoryview(b'hello')  # success
mview[:] = array.array('b', b'hello')  # fail
----
    mview[:] = array.array('b', b'hello')
ValueError: memoryview assignment: lvalue and rvalue have different structures
----

----------
components: Library (Lib)
messages: 327133
nosy: aparamon
priority: normal
severity: normal
status: open
title: Cannot assign memoryview values from array.array
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34905>
_______________________________________


More information about the New-bugs-announce mailing list