[issue41879] Outdated description of async iterables in documentation of async for statement

Nick Gaya report at bugs.python.org
Mon Sep 28 16:15:35 EDT 2020


New submission from Nick Gaya <nicholasgaya+github at gmail.com>:

The documentation for the `async for` statement incorrectly states that "An asynchronous iterable is able to call asynchronous code in its iter implementation". Actually, this behavior was deprecated in Python 3.6 and removed in Python 3.7.  As of Python 3.7, the `__aiter__()` method must return an asynchronous iterator directly.

Suggested fix: Update the `async for` statement description for Python 3.7+ to match the "Asynchronous Iterators" section in the data model documentation.

> An :term:`asynchronous iterator` can call asynchronous code in its *next* method.

Relevant documentation:
- https://docs.python.org/3/reference/compound_stmts.html#the-async-for-statement
- https://docs.python.org/3/reference/datamodel.html#asynchronous-iterators

----------
assignee: docs at python
components: Documentation
messages: 377621
nosy: docs at python, nickgaya
priority: normal
severity: normal
status: open
title: Outdated description of async iterables in documentation of async for statement
versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41879>
_______________________________________


More information about the Python-bugs-list mailing list