mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
Split combined code/doctest code blocks in two blocks, to enable proper highlighting.
This commit is contained in:
parent
90c3fb6e76
commit
2cdee708e9
1 changed files with 4 additions and 0 deletions
|
@ -754,6 +754,8 @@ returns an object with a :meth:`__next__` method. If the class defines
|
|||
self.index = self.index - 1
|
||||
return self.data[self.index]
|
||||
|
||||
::
|
||||
|
||||
>>> rev = Reverse('spam')
|
||||
>>> iter(rev)
|
||||
<__main__.Reverse object at 0x00A1DB50>
|
||||
|
@ -782,6 +784,8 @@ easy to create::
|
|||
for index in range(len(data)-1, -1, -1):
|
||||
yield data[index]
|
||||
|
||||
::
|
||||
|
||||
>>> for char in reverse('golf'):
|
||||
... print(char)
|
||||
...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue