Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e9218a1a
Kaydet (Commit)
e9218a1a
authored
Haz 26, 2001
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove the restriction on a mapping's .update() method.
üst
51acc8d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
libstdtypes.tex
Doc/lib/libstdtypes.tex
+7
-9
No files found.
Doc/lib/libstdtypes.tex
Dosyayı görüntüle @
e9218a1a
...
@@ -933,19 +933,19 @@ arbitrary objects):
...
@@ -933,19 +933,19 @@ arbitrary objects):
\lineiii
{
\var
{
a
}
.keys()
}{
a copy of
\var
{
a
}
's list of keys
}{
(3)
}
\lineiii
{
\var
{
a
}
.keys()
}{
a copy of
\var
{
a
}
's list of keys
}{
(3)
}
\lineiii
{
\var
{
a
}
.update(
\var
{
b
}
)
}
\lineiii
{
\var
{
a
}
.update(
\var
{
b
}
)
}
{
\code
{
for k in
\var
{
b
}
.keys():
\var
{
a
}
[k] =
\var
{
b
}
[k]
}}
{
\code
{
for k in
\var
{
b
}
.keys():
\var
{
a
}
[k] =
\var
{
b
}
[k]
}}
{
(4)
}
{}
\lineiii
{
\var
{
a
}
.values()
}{
a copy of
\var
{
a
}
's list of values
}{
(3)
}
\lineiii
{
\var
{
a
}
.values()
}{
a copy of
\var
{
a
}
's list of values
}{
(3)
}
\lineiii
{
\var
{
a
}
.get(
\var
{
k
}
\optional
{
,
\var
{
x
}}
)
}
\lineiii
{
\var
{
a
}
.get(
\var
{
k
}
\optional
{
,
\var
{
x
}}
)
}
{
\code
{
\var
{
a
}
[
\var
{
k
}
]
}
if
\code
{
\var
{
k
}
in
\var
{
a
}}
,
{
\code
{
\var
{
a
}
[
\var
{
k
}
]
}
if
\code
{
\var
{
k
}
in
\var
{
a
}}
,
else
\var
{
x
}}
else
\var
{
x
}}
{
(
5
)
}
{
(
4
)
}
\lineiii
{
\var
{
a
}
.setdefault(
\var
{
k
}
\optional
{
,
\var
{
x
}}
)
}
\lineiii
{
\var
{
a
}
.setdefault(
\var
{
k
}
\optional
{
,
\var
{
x
}}
)
}
{
\code
{
\var
{
a
}
[
\var
{
k
}
]
}
if
\code
{
\var
{
k
}
in
\var
{
a
}}
,
{
\code
{
\var
{
a
}
[
\var
{
k
}
]
}
if
\code
{
\var
{
k
}
in
\var
{
a
}}
,
else
\var
{
x
}
(also setting it)
}
else
\var
{
x
}
(also setting it)
}
{
(
6
)
}
{
(
5
)
}
\lineiii
{
\var
{
a
}
.popitem()
}
\lineiii
{
\var
{
a
}
.popitem()
}
{
remove and return an arbitrary (
\var
{
key
}
,
\var
{
value
}
) pair
}
{
remove and return an arbitrary (
\var
{
key
}
,
\var
{
value
}
) pair
}
{
(
7
)
}
{
(
6
)
}
\lineiii
{
\var
{
a
}
.iteritems()
}
\lineiii
{
\var
{
a
}
.iteritems()
}
{
return an iterator over (
\var
{
key
}
,
\var
{
value
}
) pairs
}
{
return an iterator over (
\var
{
key
}
,
\var
{
value
}
) pairs
}
{
(2)
}
{
(2)
}
...
@@ -972,17 +972,15 @@ correspond. This allows the creation of \code{(\var{value},
...
@@ -972,17 +972,15 @@ correspond. This allows the creation of \code{(\var{value},
\var
{
key
}
)
}
pairs using
\function
{
zip()
}
:
\samp
{
pairs =
\var
{
key
}
)
}
pairs using
\function
{
zip()
}
:
\samp
{
pairs =
zip(
\var
{
a
}
.values(),
\var
{
a
}
.keys())
}
.
zip(
\var
{
a
}
.values(),
\var
{
a
}
.keys())
}
.
\item
[(4)]
\var
{
b
}
must be of the same type as
\var
{
a
}
.
\item
[(4)]
Never raises an exception if
\var
{
k
}
is not in the map,
\item
[(5)]
Never raises an exception if
\var
{
k
}
is not in the map,
instead it returns
\var
{
x
}
.
\var
{
x
}
is optional; when
\var
{
x
}
is not
instead it returns
\var
{
x
}
.
\var
{
x
}
is optional; when
\var
{
x
}
is not
provided and
\var
{
k
}
is not in the map,
\code
{
None
}
is returned.
provided and
\var
{
k
}
is not in the map,
\code
{
None
}
is returned.
\item
[(
6
)]
\function
{
setdefault()
}
is like
\function
{
get()
}
, except
\item
[(
5
)]
\function
{
setdefault()
}
is like
\function
{
get()
}
, except
that if
\var
{
k
}
is missing,
\var
{
x
}
is both returned and inserted into
that if
\var
{
k
}
is missing,
\var
{
x
}
is both returned and inserted into
the dictionary as the value of
\var
{
k
}
.
the dictionary as the value of
\var
{
k
}
.
\item
[(
7
)]
\function
{
popitem()
}
is useful to destructively iterate
\item
[(
6
)]
\function
{
popitem()
}
is useful to destructively iterate
over a dictionary, as often used in set algorithms.
over a dictionary, as often used in set algorithms.
\end{description}
\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