diff options
author | Georg Brandl <georg@python.org> | 2010-04-02 09:11:49 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-04-02 09:11:49 (GMT) |
commit | ea2d38947461039b49ff2f04d28bf14bf92194df (patch) | |
tree | 35ec51664a8796b6df8bbaa2d5020041a2aa0a19 | |
parent | 677fdec8fcf18d0fd7f7b87c3b8adb0afe6dbd96 (diff) | |
download | cpython-ea2d38947461039b49ff2f04d28bf14bf92194df.zip cpython-ea2d38947461039b49ff2f04d28bf14bf92194df.tar.gz cpython-ea2d38947461039b49ff2f04d28bf14bf92194df.tar.bz2 |
#8012: clarification in generator glossary entry.
-rw-r--r-- | Doc/glossary.rst | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 22c1372..9b12fce 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -217,6 +217,8 @@ Glossary performs garbage collection via reference counting and a cyclic garbage collector that is able to detect and break reference cycles. + .. index:: single: generator + generator A function which returns an iterator. It looks like a normal function except that values are returned to the caller using a :keyword:`yield` @@ -230,7 +232,7 @@ Glossary .. index:: single: generator expression generator expression - An expression that returns a generator. It looks like a normal expression + An expression that returns an iterator. It looks like a normal expression followed by a :keyword:`for` expression defining a loop variable, range, and an optional :keyword:`if` expression. The combined expression generates values for an enclosing function:: |