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
c2bc0d17
Kaydet (Commit)
c2bc0d17
authored
Şub 09, 2008
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make ABC containers inherit as documented.
üst
7e33663e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
31 deletions
+5
-31
_abcoll.py
Lib/_abcoll.py
+5
-31
No files found.
Lib/_abcoll.py
Dosyayı görüntüle @
c2bc0d17
...
...
@@ -56,7 +56,7 @@ class Iterable:
Iterable
.
register
(
str
)
class
Iterator
:
class
Iterator
(
Iterable
)
:
__metaclass__
=
ABCMeta
@abstractmethod
...
...
@@ -122,7 +122,7 @@ class Callable:
### SETS ###
class
Set
:
class
Set
(
Sized
,
Iterable
,
Container
)
:
__metaclass__
=
ABCMeta
"""A set is a finite, iterable container.
...
...
@@ -135,19 +135,6 @@ class Set:
then the other operations will automatically follow suit.
"""
@abstractmethod
def
__contains__
(
self
,
value
):
return
False
@abstractmethod
def
__iter__
(
self
):
while
False
:
yield
None
@abstractmethod
def
__len__
(
self
):
return
0
def
__le__
(
self
,
other
):
if
not
isinstance
(
other
,
Set
):
return
NotImplemented
...
...
@@ -324,7 +311,7 @@ MutableSet.register(set)
### MAPPINGS ###
class
Mapping
:
class
Mapping
(
Sized
,
Iterable
,
Container
)
:
__metaclass__
=
ABCMeta
@abstractmethod
...
...
@@ -345,15 +332,6 @@ class Mapping:
else
:
return
True
@abstractmethod
def
__len__
(
self
):
return
0
@abstractmethod
def
__iter__
(
self
):
while
False
:
yield
None
def
keys
(
self
):
return
KeysView
(
self
)
...
...
@@ -370,7 +348,7 @@ class Mapping:
def
__ne__
(
self
,
other
):
return
not
(
self
==
other
)
class
MappingView
:
class
MappingView
(
Sized
)
:
__metaclass__
=
ABCMeta
def
__init__
(
self
,
mapping
):
...
...
@@ -490,7 +468,7 @@ MutableMapping.register(dict)
### SEQUENCES ###
class
Sequence
:
class
Sequence
(
Sized
,
Iterable
,
Container
)
:
__metaclass__
=
ABCMeta
"""All the operations on a read-only sequence.
...
...
@@ -503,10 +481,6 @@ class Sequence:
def
__getitem__
(
self
,
index
):
raise
IndexError
@abstractmethod
def
__len__
(
self
):
return
0
def
__iter__
(
self
):
i
=
0
try
:
...
...
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