]> granicus.if.org Git - python/commitdiff
Both PEP 201 Lockstep Iteration and SF patch #101030 have been
authorBarry Warsaw <barry@python.org>
Thu, 3 Aug 2000 15:46:17 +0000 (15:46 +0000)
committerBarry Warsaw <barry@python.org>
Thu, 3 Aug 2000 15:46:17 +0000 (15:46 +0000)
accepted by the BDFL.

Added documentation for zip() builtin.

Doc/lib/libfuncs.tex

index 91afe4fba0b02ad2737ed92345d54fc6b94b6fa6..d00df162ddbddaa466a177b4fedc4706f1df110e 100644 (file)
@@ -703,3 +703,12 @@ them) except when a very large range is used on a memory-starved
 machine (e.g. MS-DOS) or when all of the range's elements are never
 used (e.g. when the loop is usually terminated with \keyword{break}).
 \end{funcdesc}
+
+\begin{funcdesc}{zip}{seq1\optional{, seq2\optional{, ...}}}
+This function returns a list of tuples, where each tuple contains the
+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 the argument sequences are all of the same
+length, \function{zip} is similar to \function{map} with an initial
+None argument.