range() should have been registered as a Sequence.
Needs to be backported to 2.6, 2.7, and 3.0.
This commit is contained in:
parent
afd3045025
commit
9aa53c2f01
|
@ -546,6 +546,7 @@ class Sequence(Sized, Iterable, Container):
|
|||
|
||||
Sequence.register(tuple)
|
||||
Sequence.register(str)
|
||||
Sequence.register(range)
|
||||
|
||||
|
||||
class ByteString(Sequence):
|
||||
|
|
|
@ -406,6 +406,8 @@ class TestCollectionABCs(ABCTestCase):
|
|||
for sample in [tuple, list, bytes, str]:
|
||||
self.failUnless(isinstance(sample(), Sequence))
|
||||
self.failUnless(issubclass(sample, Sequence))
|
||||
self.failUnless(isinstance(range(10), Sequence))
|
||||
self.failUnless(issubclass(range, Sequence))
|
||||
self.failUnless(issubclass(str, Sequence))
|
||||
self.validate_abstract_methods(Sequence, '__contains__', '__iter__', '__len__',
|
||||
'__getitem__')
|
||||
|
|
Loading…
Reference in New Issue