This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients Eric Appelt, gvanrossum, ncoghlan, ned.deily, yselivanov
Date 2016-12-10.04:17:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1481343445.89.0.648224783598.issue28091@psf.upfronthosting.co.za>
In-reply-to
Content
I agree with Guido that the in-practice terminology for synchronous generators is:

 "generator" = infer from context (and/or the ambiguity doesn't matter)
 "generator function" = generator iterator factory defined with "def"
 "generator iterator" = result of calling a generator function

Hence the caveat on https://docs.python.org/3/glossary.html#term-generator: "Usually refers to a generator function, but may refer to a generator iterator in some contexts. In cases where the intended meaning isn’t clear, using the full terms avoids ambiguity."

For async I believe you may be better off avoiding the term "generator" entirely, and instead going with "native async iterator":

  "native async iterator" = infer from context
  "native async iterator function" = async iterator factory defined with "async def"
  "native async iterator object" = result of calling a native async iterator function

Yes, technically there's generator machinery under the hood, but I think we're better off letting the discovery of "Oh, coroutines, native async iterators, and generators are all basically the same thing at runtime" be delayed until new users are further along in the process of using Python productively.
History
Date User Action Args
2016-12-10 04:17:25ncoghlansetrecipients: + ncoghlan, gvanrossum, ned.deily, yselivanov, Eric Appelt
2016-12-10 04:17:25ncoghlansetmessageid: <1481343445.89.0.648224783598.issue28091@psf.upfronthosting.co.za>
2016-12-10 04:17:25ncoghlanlinkissue28091 messages
2016-12-10 04:17:25ncoghlancreate