mirror of
https://github.com/python/cpython.git
synced 2025-10-28 17:13:08 +00:00
Implement PEP 380 - 'yield from' (closes #11682)
This commit is contained in:
parent
e51757f6de
commit
1f7ce62bd6
33 changed files with 872 additions and 421 deletions
|
|
@ -431,6 +431,13 @@ the stack so that it is available for further iterations of the loop.
|
|||
Pops ``TOS`` and yields it from a :term:`generator`.
|
||||
|
||||
|
||||
.. opcode:: YIELD_FROM
|
||||
|
||||
Pops ``TOS`` and delegates to it as a subiterator from a :term:`generator`.
|
||||
|
||||
.. versionadded:: 3.3
|
||||
|
||||
|
||||
.. opcode:: IMPORT_STAR
|
||||
|
||||
Loads all symbols not starting with ``'_'`` directly from the module TOS to the
|
||||
|
|
|
|||
|
|
@ -250,7 +250,16 @@ The following exceptions are the exceptions that are usually raised.
|
|||
.. exception:: StopIteration
|
||||
|
||||
Raised by built-in function :func:`next` and an :term:`iterator`\'s
|
||||
:meth:`__next__` method to signal that there are no further values.
|
||||
:meth:`__next__` method to signal that there are no further items to be
|
||||
produced by the iterator.
|
||||
|
||||
The exception object has a single attribute :attr:`value`, which is
|
||||
given as an argument when constructing the exception, and defaults
|
||||
to :const:`None`.
|
||||
|
||||
When a generator function returns, a new :exc:`StopIteration` instance is
|
||||
raised, and the value returned by the function is used as the
|
||||
:attr:`value` parameter to the constructor of the exception.
|
||||
|
||||
|
||||
.. exception:: SyntaxError
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue