pep-0492: TypeError if an object without __aiter__ is passed to async for
This commit is contained in:
parent
3aee121333
commit
f4baf032f3
|
@ -306,9 +306,9 @@ which is semantically equivalent to::
|
||||||
BLOCK2
|
BLOCK2
|
||||||
|
|
||||||
|
|
||||||
It is an error to pass a regular iterable without ``__aiter__`` method
|
It is a ``TypeError`` to pass a regular iterable without ``__aiter__``
|
||||||
to ``async for``. It is a ``SyntaxError`` to use ``async for`` outside
|
method to ``async for``. It is a ``SyntaxError`` to use ``async for``
|
||||||
of a coroutine.
|
outside of a coroutine.
|
||||||
|
|
||||||
As for with regular ``for`` statement, ``async for`` has an optional
|
As for with regular ``for`` statement, ``async for`` has an optional
|
||||||
``else`` clause.
|
``else`` clause.
|
||||||
|
|
Loading…
Reference in New Issue