mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +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
|
|
@ -1518,11 +1518,11 @@ class TestProxyFileBase(TestBase):
|
|||
# Iterate by line
|
||||
proxy.seek(0)
|
||||
iterator = iter(proxy)
|
||||
self.assert_(iterator.next() == 'foo' + os.linesep)
|
||||
self.assert_(iterator.next() == 'bar' + os.linesep)
|
||||
self.assert_(iterator.next() == 'fred' + os.linesep)
|
||||
self.assert_(iterator.next() == 'bob')
|
||||
self.assertRaises(StopIteration, lambda: iterator.next())
|
||||
self.assert_(next(iterator) == 'foo' + os.linesep)
|
||||
self.assert_(next(iterator) == 'bar' + os.linesep)
|
||||
self.assert_(next(iterator) == 'fred' + os.linesep)
|
||||
self.assert_(next(iterator) == 'bob')
|
||||
self.assertRaises(StopIteration, next, iterator)
|
||||
|
||||
def _test_seek_and_tell(self, proxy):
|
||||
# Seek and use tell to check position
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue