[Python-checkins] python/dist/src/Doc/whatsnew whatsnew24.tex, 1.31, 1.32

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Fri Feb 13 14:00:11 EST 2004


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

Modified Files:
	whatsnew24.tex 
Log Message:
* Note list optimizations
* Move an example out of a comment.



Index: whatsnew24.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew24.tex,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** whatsnew24.tex	12 Feb 2004 18:13:12 -0000	1.31
--- whatsnew24.tex	13 Feb 2004 19:00:07 -0000	1.32
***************
*** 144,160 ****
  
  \begin{verbatim}
! >>> 'a b c'.split(None, 1)
! ['a', 'b c']
! >>> 'a b c'.rsplit(None, 1)
! ['a b', 'c']
! \end{verbatim}
! 
! % Consider replacing the above example with one that is less
! % abstract and more suggestive of why the function is useful:
! %       
! %     >>> 'www.python.org'.split('.', 1)
! %    ['www', 'python.org']
! %    >>> 'www.python.org'.rsplit('.', 1)
! %    ['www.python', 'org']       
  
  \item The \method{sort()} method of lists gained three keyword
--- 144,152 ----
  
  \begin{verbatim}
! >>> 'www.python.org'.split('.', 1)
! ['www', 'python.org']
! 'www.python.org'.rsplit('.', 1)
! ['www.python', 'org']        
! \end{verbatim}      
  
  \item The \method{sort()} method of lists gained three keyword
***************
*** 268,271 ****
--- 260,272 ----
  \begin{itemize}
  
+ \item The machinery for growing and shrinking lists was optimized
+  for speed and for space efficiency.  Small lists (under six bytes)
+  never over-allocate by more than one byte.  Large lists do not
+  over-allocate by more than 1/8th.  Appending and popping from lists
+  now runs faster due to more efficient code paths and less frequent
+  use of the underlying system realloc().  List comprehensions also
+  benefit.  The amount of improvement varies between systems and shows
+  the greatest improvement on systems with poor realloc() implementations.
+ 
  \item \function{list()}, \function{tuple()}, \function{map()},
    \function{filter()}, and \function{zip()} now run several times




More information about the Python-checkins mailing list