diff options
Diffstat (limited to 'Doc/reference/simple_stmts.rst')
| -rw-r--r-- | Doc/reference/simple_stmts.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index 3dc4418..e152b16 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -492,6 +492,10 @@ generator is done and will cause :exc:`StopIteration` to be raised. The returned value (if any) is used as an argument to construct :exc:`StopIteration` and becomes the :attr:`StopIteration.value` attribute. +In an asynchronous generator function, an empty :keyword:`return` statement +indicates that the asynchronous generator is done and will cause +:exc:`StopAsyncIteration` to be raised. A non-empty :keyword:`return` +statement is a syntax error in an asynchronous generator function. .. _yield: |
