Skip to content

Commit 14b0f28

Browse files
PEP 679: Updates based on Discourse discussion (#4600)
1 parent 415c032 commit 14b0f28

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

peps/pep-0679.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Status: Draft
77
Type: Standards Track
88
Created: 07-Jan-2022
99
Python-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

1314
Abstract
@@ -132,10 +133,10 @@ specification.
132133
(Note that, without the warning specification the pure parser implementation is
133134
a small grammar change [#previmp]_).
134135
To 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

151150
Implementing in the compiler
152151
----------------------------

0 commit comments

Comments
 (0)