[Python-checkins] CVS: python/dist/src/Doc/lib libarray.tex,1.29,1.30
Fred L. Drake
fdrake@users.sourceforge.net
Wed, 01 Aug 2001 09:50:51 -0700
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv22224/lib
Modified Files:
libarray.tex
Log Message:
Fix description of buffer_info(), and add a note that there is a better
way...
This closes SF bug #444842.
Index: libarray.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libarray.tex,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** libarray.tex 2001/07/06 19:28:48 1.29
--- libarray.tex 2001/08/01 16:50:49 1.30
***************
*** 69,78 ****
\begin{methoddesc}[array]{buffer_info}{}
Return a tuple \code{(\var{address}, \var{length})} giving the current
! memory address and the length in bytes of the buffer used to hold
! array's contents. This is occasionally useful when working with
low-level (and inherently unsafe) I/O interfaces that require memory
! addresses, such as certain \cfunction{ioctl()} operations. The returned
! numbers are valid as long as the array exists and no length-changing
! operations are applied to it.
\end{methoddesc}
--- 69,87 ----
\begin{methoddesc}[array]{buffer_info}{}
Return a tuple \code{(\var{address}, \var{length})} giving the current
! memory address and the length in elements of the buffer used to hold
! array's contents. The size of the memory buffer in bytes can be
! computed as \code{\var{array}.buffer_info()[1] *
! \var{array}.itemsize}. This is occasionally useful when working with
low-level (and inherently unsafe) I/O interfaces that require memory
! addresses, such as certain \cfunction{ioctl()} operations. The
! returned numbers are valid as long as the array exists and no
! length-changing operations are applied to it.
!
! \strong{Note:} When using array objects from code written in C or
! \Cpp{} (the only way to effectively make use of this information), it
! makes more sense to use the buffer interface supported by array
! objects. This method is maintained for backward compatibility and
! should be avoided in new code. The buffer interface is documented in
! the \citetitle[../api/newTypes.html]{Python/C API Reference Manual}.
\end{methoddesc}
***************
*** 175,179 ****
an array with the same type and value using reverse quotes
(\code{``}), so long as the \function{array()} function has been
! imported using \samp{from array import array}. Examples:
\begin{verbatim}
--- 184,188 ----
an array with the same type and value using reverse quotes
(\code{``}), so long as the \function{array()} function has been
! imported using \code{from array import array}. Examples:
\begin{verbatim}