Backport 69934: Register xrange() as a Sequence.
This commit is contained in:
parent
c9332fada6
commit
8c56f8890e
|
@ -519,6 +519,7 @@ class Sequence(Sized, Iterable, Container):
|
|||
Sequence.register(tuple)
|
||||
Sequence.register(basestring)
|
||||
Sequence.register(buffer)
|
||||
Sequence.register(xrange)
|
||||
|
||||
|
||||
class MutableSequence(Sequence):
|
||||
|
|
|
@ -406,6 +406,9 @@ class TestCollectionABCs(ABCTestCase):
|
|||
self.failUnless(isinstance(sample(), Sequence))
|
||||
self.failUnless(issubclass(sample, Sequence))
|
||||
self.failUnless(issubclass(basestring, Sequence))
|
||||
self.failUnless(isinstance(range(10), Sequence))
|
||||
self.failUnless(issubclass(xrange, Sequence))
|
||||
self.failUnless(issubclass(str, Sequence))
|
||||
self.validate_abstract_methods(Sequence, '__contains__', '__iter__', '__len__',
|
||||
'__getitem__')
|
||||
|
||||
|
|
Loading…
Reference in New Issue