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
26588222
Kaydet (Commit)
26588222
authored
Agu 21, 2002
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add Raymond H to the list of authors; add some XXX comments about
possible API improvements.
üst
43db0d6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
sets.py
Lib/sets.py
+9
-0
No files found.
Lib/sets.py
Dosyayı görüntüle @
26588222
...
...
@@ -51,6 +51,9 @@ what's tested is actually `z in y'.
#
# - Guido van Rossum rewrote much of the code, made some API changes,
# and cleaned up the docstrings.
#
# - Raymond Hettinger implemented a number of speedups and other
# improvements.
__all__
=
[
'BaseSet'
,
'Set'
,
'ImmutableSet'
]
...
...
@@ -67,6 +70,7 @@ class BaseSet(object):
"""This is an abstract class."""
# Don't call this from a concrete subclass!
if
self
.
__class__
is
BaseSet
:
# XXX Maybe raise TypeError instead, like basestring()?
raise
NotImplementedError
,
(
"BaseSet is an abstract class. "
"Use Set or ImmutableSet."
)
...
...
@@ -285,6 +289,8 @@ class ImmutableSet(BaseSet):
def
__init__
(
self
,
seq
):
"""Construct an immutable set from a sequence."""
# XXX Maybe this should default seq to None?
# XXX Creating an empty immutable set is not unheard of.
self
.
_hashcode
=
None
self
.
_data
=
data
=
{}
# I don't know a faster way to do this in pure Python.
...
...
@@ -296,6 +302,9 @@ class ImmutableSet(BaseSet):
value
=
True
# XXX Should this perhaps look for _as_immutable?
# XXX If so, should use self.update(seq).
# XXX (Well, ImmutableSet doesn't have update(); the base
# XXX class could have _update() which does this though, and
# XXX we could use that here and in Set.update().)
for
key
in
seq
:
data
[
key
]
=
value
...
...
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