Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
bac41aac
Commit
bac41aac
authored
Aug 04, 2000
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added zip() builtin
parent
e3238ebf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
Doc/whatsnew/whatsnew20.tex
Doc/whatsnew/whatsnew20.tex
+8
-0
No files found.
Doc/whatsnew/whatsnew20.tex
View file @
bac41aac
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment