Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2cdee70

Browse files
committed
Split combined code/doctest code blocks in two blocks, to enable proper highlighting.
1 parent 90c3fb6 commit 2cdee70

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Doc/tutorial/classes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ returns an object with a :meth:`__next__` method. If the class defines
754754
self.index = self.index - 1
755755
return self.data[self.index]
756756

757+
::
758+
757759
>>> rev = Reverse('spam')
758760
>>> iter(rev)
759761
<__main__.Reverse object at 0x00A1DB50>
@@ -782,6 +784,8 @@ easy to create::
782784
for index in range(len(data)-1, -1, -1):
783785
yield data[index]
784786

787+
::
788+
785789
>>> for char in reverse('golf'):
786790
... print(char)
787791
...

0 commit comments

Comments
 (0)