gh-94698: add Subscript and Attribute targets to ast.for documentation (GH-94901)

### Summary

Add Attribute and Subscript as possible targets for the "ast for loop documentation".

Automerge-Triggered-By: GH:isidentical
This commit is contained in:
anilbey 2022-07-16 12:26:43 +01:00 committed by GitHub
parent 407ff6556c
commit 16b6e14cc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -1028,10 +1028,11 @@ Control flow
.. class:: For(target, iter, body, orelse, type_comment)
A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a
single :class:`Name`, :class:`Tuple` or :class:`List` node. ``iter`` holds
the item to be looped over, again as a single node. ``body`` and ``orelse``
contain lists of nodes to execute. Those in ``orelse`` are executed if the
loop finishes normally, rather than via a ``break`` statement.
single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` or
:class:`Subscript` node. ``iter`` holds the item to be looped over, again
as a single node. ``body`` and ``orelse`` contain lists of nodes to execute.
Those in ``orelse`` are executed if the loop finishes normally, rather than
via a ``break`` statement.
.. attribute:: type_comment