@@ -7,7 +7,8 @@ Status: Draft
77Type: Standards Track
88Created: 07-Jan-2022
99Python-Version: 3.15
10- Post-History: `10-Jan-2022 <https://discuss.python.org/t/pep-679-allow-parentheses-in-assert-statements/13003 >`__
10+ Post-History: `08-Sep-2025 <https://discuss.python.org/t/pep-679-new-assert-statement-syntax-with-parentheses/103634 >`__,
11+ `10-Jan-2022 <https://discuss.python.org/t/pep-679-allow-parentheses-in-assert-statements/13003 >`__
1112
1213
1314Abstract
@@ -132,10 +133,10 @@ specification.
132133(Note that, without the warning specification the pure parser implementation is
133134a small grammar change [#previmp ]_).
134135To raise the warning, the compiler must
135- be aware of the new syntax, which means that a flag would be necessary as
136- otherwise the information is lost during parsing.
137- As such, the AST of an :keyword: `assert ` would look like so,
138- with a ``paren_syntax `` flag::
136+ be aware of the new syntax, this means that an optional flag would be necessary
137+ as otherwise the information is lost during parsing.
138+ As such, the AST of an :keyword: `assert ` with parentheses would look like so,
139+ with a ``paren_syntax=1 `` flag::
139140
140141 >>> print(ast.dump(ast.parse('assert(True, "Error message")'), indent=4))
141142 Module(
@@ -145,8 +146,6 @@ with a ``paren_syntax`` flag::
145146 msg=Constant(value='Error message'),
146147 paren_syntax=1)])
147148
148- The flag would be removed in 3.18 along with the :exc: `SyntaxWarning `.
149-
150149
151150Implementing in the compiler
152151----------------------------
0 commit comments