[Python-Dev] cpython (2.7): Clarify mmap.close method behavior. Addresses issue #18815

Antoine Pitrou solipsis at pitrou.net
Tue Sep 10 08:08:46 CEST 2013


On Tue, 10 Sep 2013 07:40:21 +0200 (CEST)
senthil.kumaran <python-checkins at python.org> wrote:
> http://hg.python.org/cpython/rev/443d12b61e5b
> changeset:   85653:443d12b61e5b
> branch:      2.7
> parent:      85639:740bd510a888
> user:        Senthil Kumaran <senthil at uthcode.com>
> date:        Mon Sep 09 22:38:58 2013 -0700
> summary:
>   Clarify mmap.close method  behavior.  Addresses issue  #18815
> Patch contributed by Anoop Thomas Mathew.
> 
> files:
>   Doc/library/mmap.rst |  5 +++--
>   1 files changed, 3 insertions(+), 2 deletions(-)
> 
> 
> diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
> --- a/Doc/library/mmap.rst
> +++ b/Doc/library/mmap.rst
> @@ -152,8 +152,9 @@
>  
>     .. method:: close()
>  
> -      Close the file.  Subsequent calls to other methods of the object will
> -      result in an exception being raised.
> +      Closes the mmap. Subsequent calls to other methods of the object will
> +      result in a ValueError exception being raised. This will not close
> +      the open file.

I think this could be improved.  Anonymous mmap objects don't have an
"open file". Also, it would be clearer if it read "the underlying file"
rather than "the underlying file object" rather than "the open file",
because an mmap object is a file as well (it has read(), write(),
seek(), etc.).

Regards

Antoine.




More information about the Python-Dev mailing list