[Python-checkins] CVS: python/dist/src/Doc/lib libmarshal.tex,1.19,1.20
Tim Peters
tim_one@users.sourceforge.net
Fri, 14 Sep 2001 13:40:16 -0700
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv30226/python/doc/lib
Modified Files:
libmarshal.tex
Log Message:
Update the warning about transporting marshals across boxes with different
ideas about sizeof(long).
Index: libmarshal.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmarshal.tex,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** libmarshal.tex 2000/07/16 19:01:09 1.19
--- libmarshal.tex 2001/09/14 20:40:13 1.20
***************
*** 40,56 ****
\strong{Caveat:} On machines where C's \code{long int} type has more than
! 32 bits (such as the DEC Alpha), it
! is possible to create plain Python integers that are longer than 32
! bits. Since the current \module{marshal} module uses 32 bits to
! transfer plain Python integers, such values are silently truncated.
! This particularly affects the use of very long integer literals in
! Python modules --- these will be accepted by the parser on such
! machines, but will be silently be truncated when the module is read
! from the \file{.pyc} instead.\footnote{
! A solution would be to refuse such literals in the parser,
! since they are inherently non-portable. Another solution would be to
! let the \module{marshal} module raise an exception when an integer
! value would be truncated. At least one of these solutions will be
! implemented in a future version.}
There are functions that read/write files as well as functions
--- 40,51 ----
\strong{Caveat:} On machines where C's \code{long int} type has more than
! 32 bits (such as the DEC Alpha), it is possible to create plain Python
! integers that are longer than 32 bits.
! If such an integer is marshaled and read back in on a machine where
! C's \code{long int} type has only 32 bits, a Python long integer object
! is returned instead. While of a different type, the numeric value is
! the same. (This behavior is new in Python 2.2. In earlier versions,
! all but the least-significant 32 bits of the value were lost, and a
! warning message was printed.)
There are functions that read/write files as well as functions