diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2000-08-04 12:35:23 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2000-08-04 12:35:23 (GMT) |
commit | 581f33a4cb184a50d6057f350877c7e56dd1dca2 (patch) | |
tree | 078957e6cca08af07b762d69eef6d9e7ad9bad9c | |
parent | 3027b15c8e2a2d8098388a4d28842934025f861e (diff) | |
download | cpython-581f33a4cb184a50d6057f350877c7e56dd1dca2.zip cpython-581f33a4cb184a50d6057f350877c7e56dd1dca2.tar.gz cpython-581f33a4cb184a50d6057f350877c7e56dd1dca2.tar.bz2 |
Added zip() builtin
-rw-r--r-- | Doc/whatsnew/whatsnew20.tex | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/whatsnew/whatsnew20.tex b/Doc/whatsnew/whatsnew20.tex index e09de7e..86b8528 100644 --- a/Doc/whatsnew/whatsnew20.tex +++ b/Doc/whatsnew/whatsnew20.tex @@ -477,6 +477,14 @@ the existing '\%s' format style, which inserts the \function{str()} of its argument. For example, \code{'\%r \%s' \% ('abc', 'abc')} returns a string containing \verb|'abc' abc|. +A new built-in, \function{zip(\var{seq1}, \var{seq2}, ...)}, has been +added. \function{zip()} returns a list of tuples where each tuple +contains the i-th element from each of the argument sequences. The +difference between \function{zip()} and \code{map(None, \var{seq1}, +\var{seq2})} is that \function{map()} raises an error if the sequences +aren't all of the same length, while \function{zip()} truncates the +returned list to the length of the shortest argument sequence. + The \function{int()} and \function{long()} functions now accept an optional ``base'' parameter when the first argument is a string. \code{int('123', 10)} returns 123, while \code{int('123', 16)} returns |