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
ff63f202
Commit
ff63f202
authored
Dec 12, 2000
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"Documentation" for {}.popitem().
parent
b822c613
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
Doc/lib/libstdtypes.tex
Doc/lib/libstdtypes.tex
+6
-0
No files found.
Doc/lib/libstdtypes.tex
View file @
ff63f202
...
...
@@ -817,6 +817,9 @@ arbitrary objects):
{
\code
{
\var
{
a
}
[
\var
{
k
}
]
}
if
\code
{
\var
{
a
}
.has
_
key(
\var
{
k
}
)
}
,
else
\var
{
x
}
(also setting it)
}
{
(5)
}
\lineiii
{
\var
{
a
}
.popitem()
}
{
remove and return an arbitrary (
\var
{
key
}
,
\var
{
value
}
) pair
}
{
(6)
}
\end{tableiii}
\noindent
...
...
@@ -841,6 +844,9 @@ provided and \var{k} is not in the map, \code{None} is returned.
\item
[(5)]
\function
{
setdefault()
}
is like
\function
{
get()
}
, except
that if
\var
{
k
}
is missing,
\var
{
x
}
is both returned and inserted into
the dictionary as the value of
\var
{
k
}
.
\item
[(6)]
\function
{
popitem()
}
is useful to destructively iterate
over a dictionary, as often used in set algorithms.
\end{description}
...
...
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