diff options
author | Georg Brandl <georg@python.org> | 2007-10-21 10:52:38 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-10-21 10:52:38 (GMT) |
commit | cf3fb259329eedfa9d2c802b2ea5ced287c21e78 (patch) | |
tree | bd09350c4ac4d66064526573c19ebbcd27f77279 /Doc/tutorial | |
parent | bb75e4e5d243a32cf31b91543b06b829c63e2c70 (diff) | |
download | cpython-cf3fb259329eedfa9d2c802b2ea5ced287c21e78.zip cpython-cf3fb259329eedfa9d2c802b2ea5ced287c21e78.tar.gz cpython-cf3fb259329eedfa9d2c802b2ea5ced287c21e78.tar.bz2 |
Add :term: for generators.
Diffstat (limited to 'Doc/tutorial')
-rw-r--r-- | Doc/tutorial/classes.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index f91c3f0..d5bde44 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): |