summaryrefslogtreecommitdiff
path: root/Doc/library/mmap.rst
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-10-22 03:21:36 +0000
committerMartin Panter <vadmium+py@gmail.com>2016-10-22 03:21:36 +0000
commit73a0af3545f0e9b62ac149367c0cfbdbfe40afe4 (patch)
tree9db0bac0a71ca7296ff714745c0f4eee0b07f6a5 /Doc/library/mmap.rst
parent6f5021addeb1d9ddd3610409d2461ec79870f9a5 (diff)
parent6fec8a2a83b0f93a80bb83e76dceeda1cf9d00dc (diff)
downloadcpython-73a0af3545f0e9b62ac149367c0cfbdbfe40afe4.tar.gz
Issue #28435: Merge urllib test fixes from 3.5 into 3.6
Diffstat (limited to 'Doc/library/mmap.rst')
-rw-r--r--Doc/library/mmap.rst9
1 files changed, 7 insertions, 2 deletions
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
index f4a6f5365d..6e6e29020b 100644
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -264,13 +264,18 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
.. method:: write(bytes)
Write the bytes in *bytes* into memory at the current position of the
- file pointer; the file position is updated to point after the bytes that
- were written. If the mmap was created with :const:`ACCESS_READ`, then
+ file pointer and return the number of bytes written (never less than
+ ``len(bytes)``, since if the write fails, a :exc:`ValueError` will be
+ raised). The file position is updated to point after the bytes that
+ were written. If the mmap was created with :const:`ACCESS_READ`, then
writing to it will raise a :exc:`TypeError` exception.
.. versionchanged:: 3.5
Writable :term:`bytes-like object` is now accepted.
+ .. versionchanged:: 3.6
+ The number of bytes written is now returned.
+
.. method:: write_byte(byte)