Rule name conflict and token reference mistakes in the 3.12.0rc grammar

Grammar specification 3.12.0rc3

Rule name conflict with the follwing two rules:

fstring: star_expressions


    | FSTRING_START fstring_middle* FSTRING_END

The colon is not a soft keyword (":"), it is a token (':') in these rules:

    | NAME [type_param_bound] 
    | '*' NAME ":" expression 
    | '*' NAME 
    | '**' NAME ":" expression 
    | '**' NAME

type_param_bound: ":" expression

The equal is not a soft keyword ("="), it is a token ('=') in the following rule:

    | '{' (yield_expr | star_expressions) "="? [fstring_conversion] [fstring_full_format_spec] '}'

If this is meant to be a bug report, please open one at GitHub - python/cpython: The Python programming language .

After all, this does not cause a parsing error.
Maybe it’s a mistake from the point of view that comparing two texts is slower than comparing two integers.
It’s more like just a marking error.

However, I have opened this issue here as well.

1 Like