]> granicus.if.org Git - python/commitdiff
Split combined code/doctest code blocks in two blocks, to enable proper highlighting.
authorGeorg Brandl <georg@python.org>
Sun, 1 May 2011 20:34:31 +0000 (22:34 +0200)
committerGeorg Brandl <georg@python.org>
Sun, 1 May 2011 20:34:31 +0000 (22:34 +0200)
Doc/tutorial/classes.rst

index a0f2431e5e6b9dc82a2e39ef65d60472af4c6be4..04abcf3f2212aa587b0933e76802df29ddd3534e 100644 (file)
@@ -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)
    ...