merge with 3.2
This commit is contained in:
commit
6c32b4a601
|
@ -730,7 +730,6 @@ built-in function; this example shows how it all works::
|
||||||
>>> next(it)
|
>>> next(it)
|
||||||
'c'
|
'c'
|
||||||
>>> next(it)
|
>>> next(it)
|
||||||
|
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
File "<stdin>", line 1, in ?
|
File "<stdin>", line 1, in ?
|
||||||
next(it)
|
next(it)
|
||||||
|
@ -742,7 +741,7 @@ returns an object with a :meth:`__next__` method. If the class defines
|
||||||
:meth:`__next__`, then :meth:`__iter__` can just return ``self``::
|
:meth:`__next__`, then :meth:`__iter__` can just return ``self``::
|
||||||
|
|
||||||
class Reverse:
|
class Reverse:
|
||||||
"Iterator for looping over a sequence backwards"
|
"""Iterator for looping over a sequence backwards."""
|
||||||
def __init__(self, data):
|
def __init__(self, data):
|
||||||
self.data = data
|
self.data = data
|
||||||
self.index = len(data)
|
self.index = len(data)
|
||||||
|
|
Loading…
Reference in New Issue