[issue46485] ~ PEG operator in the grammar

Robert Einhorn report at bugs.python.org
Sun Jan 23 05:38:56 EST 2022


New submission from Robert Einhorn <robert.einhorn.hu at gmail.com>:

This is probably not an error and I may misinterpret the PEP 617, but I don't know what the ~ PEG operator means in the next rule if there is no alternative:
assignment_expression:
    | NAME ':=' ~ expression


And similarly with this rule if there is no more alternative:
assignment:
    | NAME ':' expression ['=' annotated_rhs ] 
    | ('(' single_target ')' 
         | single_subscript_attribute_target) ':' expression ['=' annotated_rhs ] 
    | (star_targets '=' )+ (yield_expr | star_expressions) !'=' [TYPE_COMMENT] 
    | single_target augassign ~ (yield_expr | star_expressions)

Related links:
https://docs.python.org/3/reference/grammar.html
https://www.python.org/dev/peps/pep-0617/#id9

----------
components: Parser
messages: 411360
nosy: RobEin, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: ~ PEG operator in the grammar
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46485>
_______________________________________


More information about the Python-bugs-list mailing list