[issue15625] Support u and w codes in memoryview

Марк Коренберг report at bugs.python.org
Wed May 25 08:04:08 EDT 2016


Марк Коренберг added the comment:

Trigger the same bug....

I want to effectively slice big unicode string. So I decide to use memoryview for that in order to eliminate memory copying.

In [33]: a = array.array('u', 'превед')
In [34]: m = memoryview(a)
In [35]: m[2:]
Out[35]: <memory at 0x7efc98fcc048>
In [36]: m[0]
...
NotImplementedError: memoryview: format w not supported


1. Why format 'w' error if I asked 'u' ?
2. Format 'w' is not listed in https://docs.python.org/3.5/library/array.html
3. What is alternative for fast slicing, like memoryview(bytearray(b'test')), but for unicode ?

----------
nosy: +mmarkk

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15625>
_______________________________________


More information about the Python-bugs-list mailing list