Skip to content

Commit 16b6e14

Browse files
authored
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
1 parent 407ff65 commit 16b6e14

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Doc/library/ast.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,10 +1028,11 @@ Control flow
10281028
.. class:: For(target, iter, body, orelse, type_comment)
10291029

10301030
A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a
1031-
single :class:`Name`, :class:`Tuple` or :class:`List` node. ``iter`` holds
1032-
the item to be looped over, again as a single node. ``body`` and ``orelse``
1033-
contain lists of nodes to execute. Those in ``orelse`` are executed if the
1034-
loop finishes normally, rather than via a ``break`` statement.
1031+
single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` or
1032+
:class:`Subscript` node. ``iter`` holds the item to be looped over, again
1033+
as a single node. ``body`` and ``orelse`` contain lists of nodes to execute.
1034+
Those in ``orelse`` are executed if the loop finishes normally, rather than
1035+
via a ``break`` statement.
10351036

10361037
.. attribute:: type_comment
10371038

0 commit comments

Comments
 (0)