[docs] Fix a documentation bug in python v3.2.2 documentation

kan lianlian lianliankan2010 at gmail.com
Fri Feb 17 15:24:35 CET 2012


There is an example about memoryview objects in section 4.9:
==========================================
>>> data = bytearray(b'abcefg')
>>> v = memoryview(data)
>>> v.readonly
False
>>> v[0] = b'z'
>>> data
bytearray(b'zbcefg')
>>> v[1:4] = b'123'
>>> data
bytearray(b'a123fg')                       ### This line is wrong.
>>> v[2] = b'spam'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: cannot modify size of memoryview object
==========================================

After v[0] = b'z' and  v[1:4] = b'123', data should be bytearray(b'z123efg'),
but not bytearray(b'a123fg'). That's it.


INT3/uiq8
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20120217/83a84647/attachment.html>


More information about the docs mailing list