New submission from Nick Gaya <nicholasgaya+git...@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@python
components: Documentation
messages: 377621
nosy: docs@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue41879>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to