[Python-checkins] python/dist/src/Doc/lib libfuncs.tex,1.143,1.144
rhettinger@users.sourceforge.net
rhettinger@users.sourceforge.net
Sat, 02 Aug 2003 00:42:59 -0700
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv4929/Doc/lib
Modified Files:
libfuncs.tex
Log Message:
As discussed on python-dev, changed builtin.zip() to handle zero arguments
by returning an empty list instead of raising a TypeError.
Index: libfuncs.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v
retrieving revision 1.143
retrieving revision 1.144
diff -C2 -d -r1.143 -r1.144
*** libfuncs.tex 5 Jul 2003 17:37:58 -0000 1.143
--- libfuncs.tex 2 Aug 2003 07:42:57 -0000 1.144
***************
*** 1064,1076 ****
\end{funcdesc}
! \begin{funcdesc}{zip}{seq1, \moreargs}
This function returns a list of tuples, where the \var{i}-th tuple contains
! the \var{i}-th element from each of the argument sequences. At
! least one sequence is required, otherwise a \exception{TypeError} is
! raised. The returned list is truncated in length to the length of
the shortest argument sequence. When there are multiple argument
sequences which are all of the same length, \function{zip()} is
similar to \function{map()} with an initial argument of \code{None}.
With a single sequence argument, it returns a list of 1-tuples.
\versionadded{2.0}
\end{funcdesc}
--- 1064,1080 ----
\end{funcdesc}
! \begin{funcdesc}{zip}{\optional{seq1, \moreargs}}
This function returns a list of tuples, where the \var{i}-th tuple contains
! the \var{i}-th element from each of the argument sequences.
! The returned list is truncated in length to the length of
the shortest argument sequence. When there are multiple argument
sequences which are all of the same length, \function{zip()} is
similar to \function{map()} with an initial argument of \code{None}.
With a single sequence argument, it returns a list of 1-tuples.
+ With no arguments, it returns an empty list.
\versionadded{2.0}
+
+ \versionchanged[Formerly, \function{zip()} required at least one argument
+ and \code{zip()} raised a \exception{TypeError} instead of returning
+ \code{[]}]{2.4}
\end{funcdesc}