[Python-checkins] python/dist/src/Doc/lib libfuncs.tex,1.170,1.171

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Sun Aug 8 09:17:41 CEST 2004


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32294/Doc/lib

Modified Files:
	libfuncs.tex 
Log Message:
Bug 1003935:  xrange overflows

Added XXX comment about why the undocumented PyRange_New() API function
is too broken to be worth the considerable pain of repairing.

Changed range_new() to stop using PyRange_New().  This fixes a variety
of bogus errors.  Nothing in the core uses PyRange_New() now.

Documented that xrange() is intended to be simple and fast, and that
CPython restricts its arguments, and length of its result sequence, to
native C longs.

Added some tests that failed before the patch, and repaired a test that
relied on a bogus OverflowError getting raised.


Index: libfuncs.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v
retrieving revision 1.170
retrieving revision 1.171
diff -C2 -d -r1.170 -r1.171
*** libfuncs.tex	4 Aug 2004 23:18:49 -0000	1.170
--- libfuncs.tex	8 Aug 2004 07:17:38 -0000	1.171
***************
*** 80,84 ****
    \indexii{Boolean}{type}
    \versionadded{2.2.1}
!   \versionchanged[If no argument is given, this function returns 
                    \constant{False}]{2.3}
  \end{funcdesc}
--- 80,84 ----
    \indexii{Boolean}{type}
    \versionadded{2.2.1}
!   \versionchanged[If no argument is given, this function returns
                    \constant{False}]{2.3}
  \end{funcdesc}
***************
*** 380,384 ****
    ignored).  If the file cannot be opened, \exception{IOError} is
    raised.
!   
    In addition to the standard \cfunction{fopen()} values \var{mode}
    may be \code{'U'} or \code{'rU'}. If Python is built with universal
--- 380,384 ----
    ignored).  If the file cannot be opened, \exception{IOError} is
    raised.
! 
    In addition to the standard \cfunction{fopen()} values \var{mode}
    may be \code{'U'} or \code{'rU'}. If Python is built with universal
***************
*** 393,397 ****
    file objects so opened also have an attribute called
    \member{newlines} which has a value of \code{None} (if no newlines
!   have yet been seen), \code{'\e n'}, \code{'\e r'}, \code{'\e r\e n'}, 
    or a tuple containing all the newline types seen.
  
--- 393,397 ----
    file objects so opened also have an attribute called
    \member{newlines} which has a value of \code{None} (if no newlines
!   have yet been seen), \code{'\e n'}, \code{'\e r'}, \code{'\e r\e n'},
    or a tuple containing all the newline types seen.
  
***************
*** 460,464 ****
    \var{iterable} is not specified, returns a new empty set,
    \code{frozenset([])}.
!   \versionadded{2.4}  
  \end{funcdesc}
  
--- 460,464 ----
    \var{iterable} is not specified, returns a new empty set,
    \code{frozenset([])}.
!   \versionadded{2.4}
  \end{funcdesc}
  
***************
*** 660,664 ****
  
  \begin{funcdesc}{object}{}
!   Return a new featureless object.  \function{object()} is a base 
    for all new style classes.  It has the methods that are common
    to all instances of new style classes.
--- 660,664 ----
  
  \begin{funcdesc}{object}{}
!   Return a new featureless object.  \function{object()} is a base
    for all new style classes.  It has the methods that are common
    to all instances of new style classes.
***************
*** 902,906 ****
    be \class{frozenset} objects.  If \var{iterable} is not specified,
    returns a new empty set, \code{set([])}.
!   \versionadded{2.4}  
  \end{funcdesc}
  
--- 902,906 ----
    be \class{frozenset} objects.  If \var{iterable} is not specified,
    returns a new empty set, \code{set([])}.
!   \versionadded{2.4}
  \end{funcdesc}
  
***************
*** 932,936 ****
    The optional arguments \var{cmp}, \var{key}, and \var{reverse}
    have the same meaning as those for the \method{list.sort()} method.
!   \versionadded{2.4}    
  \end{funcdesc}
  
--- 932,936 ----
    The optional arguments \var{cmp}, \var{key}, and \var{reverse}
    have the same meaning as those for the \method{list.sort()} method.
!   \versionadded{2.4}
  \end{funcdesc}
  
***************
*** 1100,1103 ****
--- 1100,1109 ----
    machine or when all of the range's elements are never used (such as
    when the loop is usually terminated with \keyword{break}).
+ 
+   \note{\function{xrange()} is intended to be simple and fast.
+         Implementations may impose restrictions to achieve this.
+         The C implementation of Python restricts all arguments to
+         native C longs ("short" Python integers), and also requires
+         that that number of elements fit in a native C long.}
  \end{funcdesc}
  
***************
*** 1115,1123 ****
    \versionchanged[Formerly, \function{zip()} required at least one argument
    and \code{zip()} raised a \exception{TypeError} instead of returning
!   an empty list.]{2.4} 
  \end{funcdesc}
  
  
! % ---------------------------------------------------------------------------	
  
  
--- 1121,1129 ----
    \versionchanged[Formerly, \function{zip()} required at least one argument
    and \code{zip()} raised a \exception{TypeError} instead of returning
!   an empty list.]{2.4}
  \end{funcdesc}
  
  
! % ---------------------------------------------------------------------------
  
  



More information about the Python-checkins mailing list