Message365537
| Author |
pablogsal |
| Recipients |
pablogsal |
| Date |
2020年04月02日.00:22:24 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1585786944.89.0.491246758826.issue40147@roundup.psfhosted.org> |
| In-reply-to |
| Content |
When a keyword is repeated in a call for instance:
'f(1, x=2, *(3, 4), x=5)'
we raise a SyntaxError:
File "lel.py", line 1
f(1, x=2, *(3, 4), x=5)
^
SyntaxError: keyword argument repeated
This error is raised from the AST but there is nothing technically wrong with that code from the grammar perspective. Indeed, the grammar must accepts that code, but the check must fail later (in the compiler for instance) because the code is semantically invalid. When working on the new PEG parser we have encountered this situation and changing the parser would remove the check as it is right now. For these reasons, the check should be moved from the AST to the compiler. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2020年04月02日 00:22:24 | pablogsal | set | recipients:
+ pablogsal |
| 2020年04月02日 00:22:24 | pablogsal | set | messageid: <1585786944.89.0.491246758826.issue40147@roundup.psfhosted.org> |
| 2020年04月02日 00:22:24 | pablogsal | link | issue40147 messages |
| 2020年04月02日 00:22:24 | pablogsal | create |
|