PEP 3114: rename .next() to .__next__() and add next() builtin.

This commit is contained in:
Georg Brandl 2007-04-21 15:47:16 +00:00
parent 4d2adcca52
commit a18af4e7a2
83 changed files with 495 additions and 425 deletions

View file

@ -99,10 +99,10 @@ class UnicodeTest(
def test_iterators(self):
# Make sure unicode objects have an __iter__ method
it = u"\u1111\u2222\u3333".__iter__()
self.assertEqual(it.next(), u"\u1111")
self.assertEqual(it.next(), u"\u2222")
self.assertEqual(it.next(), u"\u3333")
self.assertRaises(StopIteration, it.next)
self.assertEqual(next(it), u"\u1111")
self.assertEqual(next(it), u"\u2222")
self.assertEqual(next(it), u"\u3333")
self.assertRaises(StopIteration, next, it)
def test_count(self):
string_tests.CommonTest.test_count(self)