From: Georg Brandl Date: Sun, 1 May 2011 20:34:31 +0000 (+0200) Subject: Split combined code/doctest code blocks in two blocks, to enable proper highlighting. X-Git-Tag: v3.3.0a1~2444 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cdee708e9ec4c8445f2a269b87efb9a148e097f;p=thirdparty%2FPython%2Fcpython.git Split combined code/doctest code blocks in two blocks, to enable proper highlighting. --- diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index a0f2431e5e6b..04abcf3f2212 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) ...