Home
last modified time | relevance | path

Searched refs:SequenceClass (Results 1 – 3 of 3) sorted by relevance

/external/python/cpython2/Lib/test/
Dtest_iter.py40 class SequenceClass: class
119 self.check_for_loop(SequenceClass(10), range(10))
123 self.check_iterator(iter(SequenceClass(10)), range(10))
126 a = SequenceClass(5)
193 class MySequenceClass(SequenceClass):
197 return SequenceClass.__getitem__(self, i)
209 class MySequenceClass(SequenceClass):
213 return SequenceClass.__getitem__(self, i)
271 self.assertEqual(list(SequenceClass(5)), range(5))
272 self.assertEqual(list(SequenceClass(0)), [])
[all …]
/external/python/cpython3/Lib/test/
Dtest_iter.py44 class SequenceClass: class
159 self.check_for_loop(SequenceClass(10), list(range(10)))
163 self.check_iterator(iter(SequenceClass(10)), list(range(10)))
166 orig = SequenceClass(5)
202 a = SequenceClass(5)
269 class MySequenceClass(SequenceClass):
273 return SequenceClass.__getitem__(self, i)
285 class MySequenceClass(SequenceClass):
289 return SequenceClass.__getitem__(self, i)
340 self.assertEqual(list(SequenceClass(5)), list(range(5)))
[all …]
Dtest_functools.py811 class SequenceClass: class
821 self.assertEqual(self.func(add, SequenceClass(5)), 10)
822 self.assertEqual(self.func(add, SequenceClass(5), 42), 52)
823 self.assertRaises(TypeError, self.func, add, SequenceClass(0))
824 self.assertEqual(self.func(add, SequenceClass(0), 42), 42)
825 self.assertEqual(self.func(add, SequenceClass(1)), 0)
826 self.assertEqual(self.func(add, SequenceClass(1), 42), 42)