[Python-checkins] CVS: python/dist/src/Doc/lib libarray.tex,1.32,1.33
Fred L. Drake
fdrake@users.sourceforge.net
2002年4月01日 15:05:12 -0800
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv7006/lib
Modified Files:
libarray.tex
Log Message:
Fix up the documentation of the type codes to give both the C and Python
types for each code, and give the actual C types.
Clarified the support for slice operations and note when some TypeError
exceptions are raised.
This closes SF bugs 518767 and 536469.
Index: libarray.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libarray.tex,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** libarray.tex 1 Mar 2002 10:27:01 -0000 1.32
--- libarray.tex 1 Apr 2002 23:05:10 -0000 1.33
***************
*** 14,31 ****
codes are defined:
! \begin{tableiii}{c|l|c}{code}{Type code}{C Type}{Minimum size in bytes}
! \lineiii{'c'}{character}{1}
! \lineiii{'b'}{signed int}{1}
! \lineiii{'B'}{unsigned int}{1}
! \lineiii{'u'}{Unicode character}{2}
! \lineiii{'h'}{signed int}{2}
! \lineiii{'H'}{unsigned int}{2}
! \lineiii{'i'}{signed int}{2}
! \lineiii{'I'}{unsigned int}{2}
! \lineiii{'l'}{signed int}{4}
! \lineiii{'L'}{unsigned int}{4}
! \lineiii{'f'}{float}{4}
! \lineiii{'d'}{double}{8}
! \end{tableiii}
The actual representation of values is determined by the machine
--- 14,31 ----
codes are defined:
! \begin{tableiv}{c|l|l|c}{code}{Type code}{C Type}{Python Type}{Minimum size in bytes}
! \lineiv{'c'}{char} {character} {1}
! \lineiv{'b'}{signed char} {int} {1}
! \lineiv{'B'}{unsigned char} {int} {1}
! \lineiv{'u'}{Py_UNICODE} {Unicode character}{2}
! \lineiv{'h'}{signed short} {int} {2}
! \lineiv{'H'}{unsigned short}{int} {2}
! \lineiv{'i'}{signed int} {int} {2}
! \lineiv{'I'}{unsigned int} {long} {2}
! \lineiv{'l'}{signed long} {int} {4}
! \lineiv{'L'}{unsigned long} {long} {4}
! \lineiv{'f'}{float} {float} {4}
! \lineiv{'d'}{double} {float} {8}
! \end{tableiv}
The actual representation of values is determined by the machine
***************
*** 54,59 ****
Array objects support the ordinary sequence operations of
! indexing, slicing, concatenation, and multiplication. The
! following data items and methods are also supported:
\begin{memberdesc}[array]{typecode}
--- 54,64 ----
Array objects support the ordinary sequence operations of
! indexing, slicing, concatenation, and multiplication. When using
! slice assignment, the assigned value must be an array object with the
! same type code; in all other cases, \exception{TypeError} is raised.
! Array objects also implement the buffer interface, and may be used
! wherever buffer objects are supported.
!
! The following data items and methods are also supported:
\begin{memberdesc}[array]{typecode}
***************
*** 101,105 ****
\begin{methoddesc}[array]{extend}{a}
! Append array items from \var{a} to the end of the array.
\end{methoddesc}
--- 106,112 ----
\begin{methoddesc}[array]{extend}{a}
! Append array items from \var{a} to the end of the array. The two
! arrays must have \emph{exactly} the same type code; if not,
! \exception{TypeError} will be raised.
\end{methoddesc}