[Python-checkins] CVS: python/dist/src/Doc/lib libmmap.tex,1.7,1.8

Fred L. Drake fdrake@users.sourceforge.net
Mon, 03 Dec 2001 10:27:24 -0800


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv30390/lib

Modified Files:
	libmmap.tex 
Log Message:
Re-word the intro slightly to avoid reader misunderstanding: strings are not
mutable!  We do not want to shock anyone.
This closes SF bug #483805.

Re-factor so that the description of the "access" keyword parameter is not
repeated in both the descriptions of mmap().  Also, only make sure the first
description of mmap() appears in the index.  The the index link is followed,
the first is now used to locate the page on the screen; chances are really good
both will be visible.  This avoids the problem that the index entry for the
second is selected and the first version is not visible, making the reader
consider that mmap() is not available on Windows.


Index: libmmap.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmmap.tex,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** libmmap.tex	2001/11/28 07:26:15	1.7
--- libmmap.tex	2001/12/03 18:27:22	1.8
***************
*** 5,10 ****
  \modulesynopsis{Interface to memory-mapped files for \UNIX\ and Windows.}
  
! Memory-mapped file objects behave like both mutable strings and like
! file objects.  You can use mmap objects in most places where strings
  are expected; for example, you can use the \module{re} module to
  search through a memory-mapped file.  Since they're mutable, you can
--- 5,11 ----
  \modulesynopsis{Interface to memory-mapped files for \UNIX\ and Windows.}
  
! Memory-mapped file objects behave like both strings and like
! file objects.  Unlike normal string objects, however, these are
! mutable.  You can use mmap objects in most places where strings
  are expected; for example, you can use the \module{re} module to
  search through a memory-mapped file.  Since they're mutable, you can
***************
*** 24,27 ****
--- 25,43 ----
  directly (the file still needs to be closed when done).
  
+ For both the \UNIX{} and Windows versions of the function,
+ \var{access} may be specified as an optional keyword parameter.
+ \var{access} accepts one of three values: \constant{ACCESS_READ},
+ \constant{ACCESS_WRITE}, or \constant{ACCESS_COPY} to specify
+ readonly, write-through or copy-on-write memory respectively.
+ \var{access} can be used on both \UNIX{} and Windows.  If
+ \var{access} is not specified, Windows mmap returns a write-through
+ mapping.  The initial memory values for all three access types are
+ taken from the specified file.  Assignment to an
+ \constant{ACCESS_READ} memory map raises a \exception{TypeError}
+ exception.  Assignment to an \constant{ACCESS_WRITE} memory map
+ affects both memory and the underlying file.  Assigment to an
+ \constant{ACCESS_COPY} memory map affects memory but does not update
+ the underlying file.
+ 
  \begin{funcdesc}{mmap}{fileno, length\optional{, tagname\optional{, access}}}
    \strong{(Windows version)} Maps \var{length} bytes from the file
***************
*** 39,59 ****
    parameter will assist in keeping your code portable between \UNIX{}
    and Windows.
-   
-   \var{access} may be specified as an optional keyword parameter.
-   \var{access} accepts one of three values: \constant{ACCESS_READ},
-   \constant{ACCESS_WRITE}, or \constant{ACCESS_COPY} to specify
-   readonly, write-through or copy-on-write memory respectively.
-   \var{access} can be used on both \UNIX{} and Windows.  If
-   \var{access} is not specified, Windows mmap returns a write-through
-   mapping.  The initial memory values for all three access types are
-   taken from the specified file.  Assignment to an
-   \constant{ACCESS_READ} memory map raises a \exception{TypeError}
-   exception.  Assignment to an \constant{ACCESS_WRITE} memory map
-   affects both memory and the underlying file.  Assigment to an
-   \constant{ACCESS_COPY} memory map affects memory but does not update
-   the underlying file.
  \end{funcdesc}
  
! \begin{funcdesc}{mmap}{fileno, length\optional{, flags\optional{, prot\optional{, access}}}}
    \strong{(\UNIX{} version)} Maps \var{length} bytes from the file
    specified by the file descriptor \var{fileno}, and returns a mmap
--- 55,62 ----
    parameter will assist in keeping your code portable between \UNIX{}
    and Windows.
  \end{funcdesc}
  
! \begin{funcdescni}{mmap}{fileno, length\optional{, flags\optional{,
!                          prot\optional{, access}}}}
    \strong{(\UNIX{} version)} Maps \var{length} bytes from the file
    specified by the file descriptor \var{fileno}, and returns a mmap
***************
*** 73,89 ****
    
    \var{access} may be specified in lieu of \var{flags} and \var{prot}
!   as an optional keyword parameter.  \var{access} accepts one of three
!   values: \constant{ACCESS_READ}, \constant{ACCESS_WRITE}, or
!   \constant{ACCESS_COPY} to specify readonly, write-through, or
!   copy-on-write memory respectively.  \var{access} can be used on both
!   \UNIX{} and Windows.  It is an error to specify both \var{flags},
!   \var{prot} and \var{access}.  The initial memory values for all
!   three access types are taken from the specified file.  Assignment to
!   an \constant{ACCESS_READ} memory map raises a \exception{TypeError}
!   exception.  Assignment to an \constant{ACCESS_WRITE} memory map
!   affects both memory and the underlying file.  Assigment to an
!   \constant{ACCESS_COPY} memory map affects memory but does not update
!   the underlying file.
! \end{funcdesc}
  
  
--- 76,83 ----
    
    \var{access} may be specified in lieu of \var{flags} and \var{prot}
!   as an optional keyword parameter.  It is an error to specify both
!   \var{flags}, \var{prot} and \var{access}.  See the description of
!   \var{access} above for information on how to use this parameter.
! \end{funcdescni}