From cf3fb259329eedfa9d2c802b2ea5ced287c21e78 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 21 Oct 2007 10:52:38 +0000 Subject: Add :term: for generators. --- Doc/tutorial/classes.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Doc/tutorial') diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index f91c3f05fb..d5bde442d7 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -711,12 +711,12 @@ returns an object with a :meth:`next` method. If the class defines Generators ========== -Generators are a simple and powerful tool for creating iterators. They are -written like regular functions but use the :keyword:`yield` statement whenever -they want to return data. Each time :meth:`next` is called, the generator -resumes where it left-off (it remembers all the data values and which statement -was last executed). An example shows that generators can be trivially easy to -create:: +:term:`Generator`\s are a simple and powerful tool for creating iterators. They +are written like regular functions but use the :keyword:`yield` statement +whenever they want to return data. Each time :meth:`next` is called, the +generator resumes where it left-off (it remembers all the data values and which +statement was last executed). An example shows that generators can be trivially +easy to create:: def reverse(data): for index in range(len(data)-1, -1, -1): -- cgit v1.2.1