-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
doc: yield from expression can be any iterable #71833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
https://docs.python.org/3/reference/expressions.html#yield-expressions says I confirmed that this usage is correct by trying >>> def g():
yield from (1,2)
>>> i = g()
>>> next(i), next(i)
(1, 2) and then reading the PEP-380 Formal Semantics, which begins with "_i = iter(EXPR)". Hence I suggest the following replacement for the quote above: Note that 'subiterator' is spelled in the following sentences 'underlying iterable' (which I am not sure I like) and 'sub-iterator' (and 'sub-generator'). I think we should be consistent for at least the two short 'yield from' paragraphs. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: