Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(26595)

Unified Diff: Doc/library/mmap.rst

Issue 26335: Make mmap.write return the number of bytes written like other write methods
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Lib/test/test_mmap.py » ('j') | Lib/test/test_mmap.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
index b74a823..027d013 100644
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -263,7 +263,9 @@ 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
+ file pointer and return the number of bytes written (never less than
berkerpeksag 2016/02/23 00:57:52 We also need a versionchanged directive to explain
+ 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.
« no previous file with comments | « no previous file | Lib/test/test_mmap.py » ('j') | Lib/test/test_mmap.py » ('J')

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+