Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee=Noneclosed_at=<Date2016-03-02.17:31:09.579>created_at=<Date2016-02-10.22:55:37.908>labels= ['extension-modules', 'type-feature']
title='Make mmap.write return the number of bytes written like other write methods'updated_at=<Date2016-03-03.00:02:26.588>user='https://github.com/jstasiak'
Since mmap objects are said to "behave like both bytearray and like file objects" I believe it's appropriate for the mmap.write() method to return the number of bytes written like write() of other file objects/interfaces I could find in the standard library for consistency reasons:
Why I believe this would be useful: code that writes to file objects and tests the number of bytes/characters written right now will likely fail when it's passed a mmap object because its write() method returns None. With this patch applied it'll work transparently.
Please find proposed patch attached, I included information about the exception type in the documentation as it seems fitting (apologies for generating the patch using Git, I'll generate using Mercurial if necessary).