Author: raymond.hettinger
Date: Sat Feb 9 03:53:48 2008
New Revision: 60682
Modified:
python/branches/py3k/Lib/_abcoll.py
Log:
Merge r60679
Modified: python/branches/py3k/Lib/_abcoll.py
==============================================================================
--- python/branches/py3k/Lib/_abcoll.py (original)
+++ python/branches/py3k/Lib/_abcoll.py Sat Feb 9 03:53:48 2008
@@ -82,7 +82,7 @@
return NotImplemented
-class Iterator(metaclass=ABCMeta):
+class Iterator(Iterable):
@abstractmethod
def __next__(self):
@@ -157,7 +157,7 @@
### SETS ###
-class Set(metaclass=ABCMeta):
+class Set(Sized, Iterable, Container):
"""A set is a finite, iterable container.
@@ -169,19 +169,6 @@
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 @@
### MAPPINGS ###
-class Mapping(metaclass=ABCMeta):
+class Mapping(Sized, Iterable, Container):
@abstractmethod
def __getitem__(self, key):
@@ -378,15 +365,6 @@
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 @@
### SEQUENCES ###
-class Sequence(metaclass=ABCMeta):
+class Sequence(Sized, Iterable, Container):
"""All the operations on a read-only sequence.
@@ -535,10 +513,6 @@
def __getitem__(self, index):
raise IndexError
- @abstractmethod
- def __len__(self):
- return 0
-
def __iter__(self):
i = 0
try:
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins