[Python-checkins] r69934 - in python/branches/py3k/Lib: _abcoll.py test/test_collections.py

raymond.hettinger python-checkins at python.org
Tue Feb 24 12:25:35 CET 2009


Author: raymond.hettinger
Date: Tue Feb 24 12:25:35 2009
New Revision: 69934
Log:
range() should have been registered as a Sequence.
Needs to be backported to 2.6, 2.7, and 3.0.
Modified:
 python/branches/py3k/Lib/_abcoll.py
 python/branches/py3k/Lib/test/test_collections.py
Modified: python/branches/py3k/Lib/_abcoll.py
==============================================================================
--- python/branches/py3k/Lib/_abcoll.py	(original)
+++ python/branches/py3k/Lib/_abcoll.py	Tue Feb 24 12:25:35 2009
@@ -546,6 +546,7 @@
 
 Sequence.register(tuple)
 Sequence.register(str)
+Sequence.register(range)
 
 
 class ByteString(Sequence):
Modified: python/branches/py3k/Lib/test/test_collections.py
==============================================================================
--- python/branches/py3k/Lib/test/test_collections.py	(original)
+++ python/branches/py3k/Lib/test/test_collections.py	Tue Feb 24 12:25:35 2009
@@ -406,6 +406,8 @@
 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__')


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /