summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/tutorial/classes.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst
index a0f2431..04abcf3 100644
--- a/Doc/tutorial/classes.rst
+++ b/Doc/tutorial/classes.rst
@@ -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)
...