diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2021-02-21 02:33:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-21 02:33:25 (GMT) |
commit | 2f9ef514fb24b6a95bd3272885f197752810c107 (patch) | |
tree | 77654f6401b7288f925a08bd3e557ae39e973d5b /Doc/reference | |
parent | bf838a6e7eec2063a17c7c33dfa94afeef116f36 (diff) | |
download | cpython-2f9ef514fb24b6a95bd3272885f197752810c107.zip cpython-2f9ef514fb24b6a95bd3272885f197752810c107.tar.gz cpython-2f9ef514fb24b6a95bd3272885f197752810c107.tar.bz2 |
bpo-27646: Say that 'yield from' expression can be any iterable (GH-24595)
Previously, the doc at least strongly implied that it had to be an iterator.
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/expressions.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index c8c9b46..17705b1 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -478,8 +478,8 @@ allowing any pending :keyword:`finally` clauses to execute. .. index:: single: from; yield from expression -When ``yield from <expr>`` is used, it treats the supplied expression as -a subiterator. All values produced by that subiterator are passed directly +When ``yield from <expr>`` is used, the supplied expression must be an +iterable. The values produced by iterating that iterable are passed directly to the caller of the current generator's methods. Any values passed in with :meth:`~generator.send` and any exceptions passed in with :meth:`~generator.throw` are passed to the underlying iterator if it has the |