New submission from Andrey Paramonov <para...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue34905>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to