]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-94698: add Subscript and Attribute targets to ast.for documentation (GH-94901)
authoranilbey <anil.tuncel@epfl.ch>
Sat, 16 Jul 2022 11:26:43 +0000 (12:26 +0100)
committerGitHub <noreply@github.com>
Sat, 16 Jul 2022 11:26:43 +0000 (04:26 -0700)
### Summary

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

Automerge-Triggered-By: GH:isidentical
Doc/library/ast.rst

index b10aa7cd50d17300881888da32abf392800b028a..7ad21026f690f8add2a635dd3bbd53fab0b8ebf1 100644 (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