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
c53a894a
Kaydet (Commit)
c53a894a
authored
Eyl 12, 2009
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
d.items() -> list(d.items()) in the examples
üst
2e4b0e1d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
collections.rst
Doc/library/collections.rst
+4
-4
No files found.
Doc/library/collections.rst
Dosyayı görüntüle @
c53a894a
...
...
@@ -538,7 +538,7 @@ sequence of key-value pairs into a dictionary of lists:
>>> for k, v in s:
... d[k].append(v)
...
>>>
d.items(
)
>>>
list(d.items()
)
[('blue', [2, 4]), ('red', [1]), ('yellow', [1, 3])]
When each key is encountered for the first time, it is not already in the
...
...
@@ -553,7 +553,7 @@ simpler and faster than an equivalent technique using :meth:`dict.setdefault`:
>>> for k, v in s:
... d.setdefault(k, []).append(v)
...
>>>
d.items(
)
>>>
list(d.items()
)
[('blue', [2, 4]), ('red', [1]), ('yellow', [1, 3])]
Setting the :attr:`default_factory` to :class:`int` makes the
...
...
@@ -565,7 +565,7 @@ languages):
>>> for k in s:
... d[k] += 1
...
>>>
d.items(
)
>>>
list(d.items()
)
[('i', 4), ('p', 2), ('s', 4), ('m', 1)]
When a letter is first encountered, it is missing from the mapping, so the
...
...
@@ -592,7 +592,7 @@ Setting the :attr:`default_factory` to :class:`set` makes the
>>> for k, v in s:
... d[k].add(v)
...
>>>
d.items(
)
>>>
list(d.items()
)
[('blue', set([2, 4])), ('red', set([1, 3]))]
...
...
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