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
8984370c
Kaydet (Commit)
8984370c
authored
Eki 12, 2006
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Bug #1565919: document set types in the Language Reference.
(backport from rev. 52297)
üst
f0db92a6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
ref3.tex
Doc/ref/ref3.tex
+35
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Doc/ref/ref3.tex
Dosyayı görüntüle @
8984370c
...
...
@@ -379,6 +379,41 @@ additional example of a mutable sequence type.
\end{description}
% Sequences
\item
[Set types]
These represent unordered, finite sets of unique, immutable objects.
As such, they cannot be indexed by any subscript. However, they can be
iterated over, and the built-in function
\function
{
len()
}
returns the
number of items in a set. Common uses for sets are
fast membership testing, removing duplicates from a sequence, and
computing mathematical operations such as intersection, union, difference,
and symmetric difference.
\bifuncindex
{
len
}
\obindex
{
set type
}
For set elements, the same immutability rules apply as for dictionary
keys. Note that numeric types obey the normal rules for numeric
comparison: if two numbers compare equal (e.g.,
\code
{
1
}
and
\code
{
1.0
}
), only one of them can be contained in a set.
There are currently two intrinsic set types:
\begin{description}
\item
[Sets]
These
\obindex
{
set
}
represent a mutable set. They are created by the
built-in
\function
{
set()
}
constructor and can be modified afterwards
by several methods, such as
\method
{
add()
}
.
\item
[Frozen sets]
These
\obindex
{
frozenset
}
represent an immutable set. They are created by
the built-in
\function
{
frozenset()
}
constructor. As a frozenset is
immutable and hashable, it can be used again as an element of another set,
or as a dictionary key.
\end{description}
% Set types
\item
[Mappings]
These represent finite sets of objects indexed by arbitrary index sets.
The subscript notation
\code
{
a[k]
}
selects the item indexed
...
...
Misc/NEWS
Dosyayı görüntüle @
8984370c
...
...
@@ -191,6 +191,8 @@ Tests
Documentation
-------------
-
Bug
#
1565919
:
document
set
types
in
the
Language
Reference
.
-
Bug
#
1546052
:
clarify
that
PyString_FromString
(
AndSize
)
copies
the
string
pointed
to
by
its
parameter
.
...
...
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