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
4295443c
Kaydet (Commit)
4295443c
authored
Agu 19, 2002
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Extend some comments on the order of values in the returns from
dict.items/keys/values/iteritems/iterkeys/itervalues().
üst
4c7e2022
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
libstdtypes.tex
Doc/lib/libstdtypes.tex
+14
-8
No files found.
Doc/lib/libstdtypes.tex
Dosyayı görüntüle @
4295443c
...
@@ -1022,13 +1022,13 @@ arbitrary objects):
...
@@ -1022,13 +1022,13 @@ arbitrary objects):
{
(6)
}
{
(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)
, (3)
}
\lineiii
{
\var
{
a
}
.iterkeys()
}
\lineiii
{
\var
{
a
}
.iterkeys()
}
{
return an iterator over the mapping's keys
}
{
return an iterator over the mapping's keys
}
{
(2)
}
{
(2)
, (3)
}
\lineiii
{
\var
{
a
}
.itervalues()
}
\lineiii
{
\var
{
a
}
.itervalues()
}
{
return an iterator over the mapping's values
}
{
return an iterator over the mapping's values
}
{
(2)
}
{
(2)
, (3)
}
\end{tableiii}
\end{tableiii}
\noindent
\noindent
...
@@ -1040,11 +1040,17 @@ in the map.
...
@@ -1040,11 +1040,17 @@ in the map.
\item
[(2)]
\versionadded
{
2.2
}
\item
[(2)]
\versionadded
{
2.2
}
\item
[(3)]
Keys and values are listed in random order. If
\item
[(3)]
Keys and values are listed in random order. If
\method
{
keys()
}
and
\method
{
values()
}
are called with no intervening
\method
{
items()
}
,
\method
{
keys()
}
,
\method
{
values()
}
,
modifications to the dictionary, the two lists will directly
\method
{
iteritems()
}
,
\method
{
iterkeys()
}
, and
\method
{
itervalues()
}
correspond. This allows the creation of
\code
{
(
\var
{
value
}
,
are called with no intervening modifications to the dictionary, the
\var
{
key
}
)
}
pairs using
\function
{
zip()
}
:
\samp
{
pairs =
lists will directly correspond. This allows the creation of
zip(
\var
{
a
}
.values(),
\var
{
a
}
.keys())
}
.
\code
{
(
\var
{
value
}
,
\var
{
key
}
)
}
pairs using
\function
{
zip()
}
:
\samp
{
pairs = zip(
\var
{
a
}
.values(),
\var
{
a
}
.keys())
}
. The same
relationship holds for the
\method
{
iterkeys()
}
and
\method
{
itervalues()
}
methods:
\samp
{
pairs = zip(
\var
{
a
}
.itervalues(),
\var
{
a
}
.iterkeys())
}
provides the same value for
\code
{
pairs
}
.
Another way to create the same list is
\samp
{
pairs = [(v, k) for (k,
v) in
\var
{
a
}
.iteritems()]
}
.
\item
[(4)]
Never raises an exception if
\var
{
k
}
is not in the map,
\item
[(4)]
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
...
...
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