[New-bugs-announce] [issue44085] Remaining invalid rules in simplified grammar

Pierre Quentel report at bugs.python.org
Sun May 9 03:22:12 EDT 2021


New submission from Pierre Quentel <pierre.quentel at gmail.com>:

In the simplified version of Python grammar at https://docs.python.org/3.10/reference/grammar.html, most 'invalid_<rule>' from the complete grammar at https://github.com/python/cpython/blob/3.10/Grammar/python.gram have been removed, but 2 of them remain :

primary:
    | invalid_primary  # must be before 'primay genexp' because of invalid_genexp

dict:
    | '{' invalid_double_starred_kvpairs '}'

I suppose that the simplified version is extracted from the complete grammar with a program, and this program doesn't detect the 'invalid_<rule>' that don't end the line, since these 2 occurrences correspond to the only such lines in the complete grammar

primary[expr_ty]:
    | invalid_primary  # must be before 'primay genexp' because of invalid_genexp

dict[expr_ty]:
    | '{' invalid_double_starred_kvpairs '}'

Also note the typo in the comment : 'primay genexp' instead of 'primary genexp'

----------
assignee: docs at python
components: Documentation
messages: 393306
nosy: docs at python, quentel
priority: normal
severity: normal
status: open
title: Remaining invalid rules in simplified grammar
versions: Python 3.10

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


More information about the New-bugs-announce mailing list