[Python-checkins] gh-94698: add Subscript and Attribute targets to ast.for documentation (GH-94901)
miss-islington
webhook-mailer at python.org
Sat Jul 16 07:26:51 EDT 2022
https://github.com/python/cpython/commit/16b6e14cc291865ecaf50fa57d0685da94496567
commit: 16b6e14cc291865ecaf50fa57d0685da94496567
branch: main
author: anilbey <anil.tuncel at epfl.ch>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-07-16T04:26:43-07:00
summary:
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
files:
M Doc/library/ast.rst
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst
index b10aa7cd50d17..7ad21026f690f 100644
--- a/Doc/library/ast.rst
+++ b/Doc/library/ast.rst
@@ -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
More information about the Python-checkins
mailing list