[Python-checkins] CVS: python/dist/src/Doc/lib libstdtypes.tex,1.41,1.42 libfuncs.tex,1.71,1.72

Fred L. Drake python-dev@python.org
Fri, 17 Nov 2000 11:44:17 -0800


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv4419/lib

Modified Files:
	libstdtypes.tex libfuncs.tex 
Log Message:

Added information about the %r string formatting conversion.  Added note
about the interpretation of radix 0 for int(), and added description of
the optional radix argument for long().  Based on comments from Reuben
Sumner <rasumner@users.sourceforge.net>.

This closes bug #121672.


Index: libstdtypes.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -r1.41 -r1.42
*** libstdtypes.tex	2000/11/06 20:17:37	1.41
--- libstdtypes.tex	2000/11/17 19:44:14	1.42
***************
*** 602,608 ****
  argument, the right argument may also be a single non-tuple
  object.\footnote{A tuple object in this case should be a singleton.
! }  The following format characters are understood:
! \code{\%}, \code{c}, \code{s}, \code{i}, \code{d}, \code{u}, \code{o},
! \code{x}, \code{X}, \code{e}, \code{E}, \code{f}, \code{g}, \code{G}. 
  Width and precision may be a \code{*} to specify that an integer argument
  specifies the actual width or precision.  The flag characters
--- 602,608 ----
  argument, the right argument may also be a single non-tuple
  object.\footnote{A tuple object in this case should be a singleton.
! }  The following format characters are understood: \code{\%},
! \code{c}, \code{r}, \code{s}, \code{i}, \code{d}, \code{u}, \code{o},
! \code{x}, \code{X}, \code{e}, \code{E}, \code{f}, \code{g}, \code{G}.
  Width and precision may be a \code{*} to specify that an integer argument
  specifies the actual width or precision.  The flag characters
***************
*** 610,614 ****
  size specifiers \code{h}, \code{l} or \code{L} may be present but are
  ignored.  The \code{\%s} conversion takes any Python object and
! converts it to a string using \code{str()} before formatting it.  The
  ANSI features \code{\%p} and \code{\%n} are not supported.  Since
  Python strings have an explicit length, \code{\%s} conversions don't
--- 610,616 ----
  size specifiers \code{h}, \code{l} or \code{L} may be present but are
  ignored.  The \code{\%s} conversion takes any Python object and
! converts it to a string using \code{str()} before formatting it; the
! \code{\%r} conversion is similar but applies the \function{repr()}
! function instead.  The
  ANSI features \code{\%p} and \code{\%n} are not supported.  Since
  Python strings have an explicit length, \code{\%s} conversions don't

Index: libfuncs.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v
retrieving revision 1.71
retrieving revision 1.72
diff -C2 -r1.71 -r1.72
*** libfuncs.tex	2000/09/12 16:23:48	1.71
--- libfuncs.tex	2000/11/17 19:44:14	1.72
***************
*** 332,337 ****
    this behaves identical to \code{string.atoi(\var{x}\optional{,
    \var{radix}})}.  The \var{radix} parameter gives the base for the
!   conversion and may be any integer in the range [2, 36].  If
!   \var{radix} is specified and \var{x} is not a string,
    \exception{TypeError} is raised.
    Otherwise, the argument may be a plain or
--- 332,339 ----
    this behaves identical to \code{string.atoi(\var{x}\optional{,
    \var{radix}})}.  The \var{radix} parameter gives the base for the
!   conversion and may be any integer in the range [2, 36], or zero.  If
!   \var{radix} is zero, the proper radix is guessed based on the
!   contents of string; the interpretation is the same as for integer
!   literals.  If \var{radix} is specified and \var{x} is not a string,
    \exception{TypeError} is raised.
    Otherwise, the argument may be a plain or
***************
*** 393,401 ****
  \end{funcdesc}
  
! \begin{funcdesc}{long}{x}
    Convert a string or number to a long integer.  If the argument is a
    string, it must contain a possibly signed decimal number of
    arbitrary size, possibly embedded in whitespace;
!   this behaves identical to \code{string.atol(\var{x})}.
    Otherwise, the argument may be a plain or
    long integer or a floating point number, and a long integer with
--- 395,405 ----
  \end{funcdesc}
  
! \begin{funcdesc}{long}{x\optional{, radix}}
    Convert a string or number to a long integer.  If the argument is a
    string, it must contain a possibly signed decimal number of
    arbitrary size, possibly embedded in whitespace;
!   this behaves identical to \code{string.atol(\var{x})}.  The
!   \var{radix} argument is interpreted in the same way as for
!   \function{int()}, and may only be given when \var{x} is a string.
    Otherwise, the argument may be a plain or
    long integer or a floating point number, and a long integer with