mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
PEP 3114: rename .next() to .__next__() and add next() builtin.
This commit is contained in:
parent
4d2adcca52
commit
a18af4e7a2
83 changed files with 495 additions and 425 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue