Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
74b6495b
Commit
74b6495b
authored
Feb 09, 2008
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge r60679
parent
77c02ebf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
30 deletions
+4
-30
Lib/_abcoll.py
Lib/_abcoll.py
+4
-30
No files found.
Lib/_abcoll.py
View file @
74b6495b
...
...
@@ -82,7 +82,7 @@ class Iterable(metaclass=ABCMeta):
return
NotImplemented
class
Iterator
(
metaclass
=
ABCMeta
):
class
Iterator
(
Iterable
):
@
abstractmethod
def
__next__
(
self
):
...
...
@@ -157,7 +157,7 @@ class Callable(metaclass=ABCMeta):
### SETS ###
class
Set
(
metaclass
=
ABCMeta
):
class
Set
(
Sized
,
Iterable
,
Container
):
"""A set is a finite, iterable container.
...
...
@@ -169,19 +169,6 @@ class Set(metaclass=ABCMeta):
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
...
...
@@ -358,7 +345,7 @@ MutableSet.register(set)
### MAPPINGS ###
class
Mapping
(
metaclass
=
ABCMeta
):
class
Mapping
(
Sized
,
Iterable
,
Container
):
@
abstractmethod
def
__getitem__
(
self
,
key
):
...
...
@@ -378,15 +365,6 @@ class Mapping(metaclass=ABCMeta):
else
:
return
True
@
abstractmethod
def
__len__
(
self
):
return
0
@
abstractmethod
def
__iter__
(
self
):
while
False
:
yield
None
def
keys
(
self
):
return
KeysView
(
self
)
...
...
@@ -523,7 +501,7 @@ MutableMapping.register(dict)
### SEQUENCES ###
class
Sequence
(
metaclass
=
ABCMeta
):
class
Sequence
(
Sized
,
Iterable
,
Container
):
"""All the operations on a read-only sequence.
...
...
@@ -535,10 +513,6 @@ class Sequence(metaclass=ABCMeta):
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