Message266335
| Author |
socketpair |
| Recipients |
Arfrever, loewis, ncoghlan, ronaldoussoren, skrah, socketpair, steve.dower, teoliphant, wiggin15 |
| Date |
2016年05月25日.12:04:08 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1464177848.51.0.703685694169.issue15625@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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 ? |
|