ruff/crates/ruff_python_parser/resources
Brent Westbrook b3c884f4f3
[syntax-errors] Parenthesized keyword argument names after Python 3.8 (#16482)
Summary
--

Unlike the other syntax errors detected so far, parenthesized keyword
arguments are only allowed *before* 3.8. It sounds like they were only
accidentally allowed before that [^1].

As an aside, you get a pretty confusing error from Python for this, so
it's nice that we can catch it:

```pycon
>>> def f(**kwargs): ...
... f((a)=1)
...
  File "<python-input-0>", line 2
    f((a)=1)
       ^^^
SyntaxError: expression cannot contain assignment, perhaps you meant "=="?
>>>
```
Test Plan
--
Inline tests.

[^1]: https://github.com/python/cpython/issues/78822
2025-03-06 12:18:13 -05:00
..
inline [syntax-errors] Parenthesized keyword argument names after Python 3.8 (#16482) 2025-03-06 12:18:13 -05:00
invalid Consider 2-character EOL before line continuation (#12035) 2024-06-26 14:00:48 +05:30
valid Add support for PEP 696 syntax (#11120) 2024-04-26 09:47:29 +02:00
.editorconfig Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30