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
ce0506ce
Kaydet (Commit)
ce0506ce
authored
Kas 17, 2008
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
rephrase dict view docs
üst
276c3718
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
stdtypes.rst
Doc/library/stdtypes.rst
+6
-9
No files found.
Doc/library/stdtypes.rst
Dosyayı görüntüle @
ce0506ce
...
@@ -1881,8 +1881,7 @@ Dictionary view objects
...
@@ -1881,8 +1881,7 @@ Dictionary view objects
The objects returned by :meth:`dict.keys`, :meth:`dict.values` and
The objects returned by :meth:`dict.keys`, :meth:`dict.values` and
:meth:`dict.items` are *view objects*. They provide a dynamic view on the
:meth:`dict.items` are *view objects*. They provide a dynamic view on the
dictionary's entries, which means that when the dictionary changes, the view
dictionary's entries, which means that when the dictionary changes, the view
reflects these changes. The keys and items views have a set-like character
reflects these changes.
since their entries
Dictionary views can be iterated over to yield their respective data, and
Dictionary views can be iterated over to yield their respective data, and
support membership tests:
support membership tests:
...
@@ -1910,8 +1909,11 @@ support membership tests:
...
@@ -1910,8 +1909,11 @@ support membership tests:
items (in the latter case, *x* should be a ``(key, value)`` tuple).
items (in the latter case, *x* should be a ``(key, value)`` tuple).
The keys and items views also provide set-like operations ("other" here refers
Keys views are set-like since their entries are unique and hashable. If all
to another dictionary view or a set):
values are hashable, so that (key, value) pairs are unique and hashable, then
the items view is also set-like. (Values views are not treated as set-like
since the entries are generally not unique.) Then these set operations are
available ("other" refers either to another view or a set):
.. describe:: dictview & other
.. describe:: dictview & other
...
@@ -1931,11 +1933,6 @@ to another dictionary view or a set):
...
@@ -1931,11 +1933,6 @@ to another dictionary view or a set):
Return the symmetric difference (all elements either in *dictview* or
Return the symmetric difference (all elements either in *dictview* or
*other*, but not in both) of the dictview and the other object as a new set.
*other*, but not in both) of the dictview and the other object as a new set.
.. warning::
Since a dictionary's values are not required to be hashable, any of these
four operations will fail if an involved dictionary contains such a value.
An example of dictionary view usage::
An example of dictionary view usage::
...
...
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