gh-150831: clarify generator, generator function, and generator iterator in glossary#150905
Conversation
Documentation build overview
83 files changed ·
|
|
I would love to move the glossary closer to actual usage. I have never heard someone say "generator iterator": it's redundant. Can we explicitly mention that "generator" is used informally for both meanings and that "generator function" and "generator iterator" are formal terms that are uncommon? |
hmm , i think its good to mention like this. thanks for the improvement 😊 |
| Generator iterators also implement the :meth:`~generator.send` method | ||
| to send a value into the suspended generator, and the | ||
| :meth:`~generator.throw` method to raise an exception at the point | ||
| where the generator was paused. See :pep:`342`. |
There was a problem hiding this comment.
Let's find a reference in the docs to explain this instead of a PEP.
There was a problem hiding this comment.
thanks for the reference 😊 .
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
|
there is also the asynchronous generator section (which is far away from the generator one because alphabetical sorting a is way before g), that should mirror the changes |
| :term:`asynchronous generator iterator` are uncommon in practice; | ||
| "asynchronous generator" alone is almost always sufficient. | ||
|
|
||
| An asynchronous generator function may contain :keyword:`await` |
There was a problem hiding this comment.
This paragraph should be in the async generator function entry below.
There was a problem hiding this comment.
thanks, i've updated this
|
@nedbat please let me know, if we need any further improvements. Thanks 😊 |
|
GH-151839 is a backport of this pull request to the 3.14 branch. |
|
GH-151840 is a backport of this pull request to the 3.15 branch. |
|
GH-151841 is a backport of this pull request to the 3.13 branch. |
fixes #150831
…sary