Issue 3689: list_reverseiterator should support __length_hint__ instead of __len__.

This commit is contained in:
Raymond Hettinger 2008-12-02 21:33:45 +00:00
parent 048690410f
commit f5b64116cc
3 changed files with 14 additions and 8 deletions

View file

@ -93,6 +93,8 @@ class CommonTest(seq_tests.CommonTest):
self.assertRaises(StopIteration, next, r)
self.assertEqual(list(reversed(self.type2test())),
self.type2test())
# Bug 3689: make sure list-reversed-iterator doesn't have __len__
self.assertRaises(TypeError, len, reversed([1,2,3]))
def test_setitem(self):
a = self.type2test([0, 1])