mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-12 07:35:07 +00:00
[syntax-errors] Positional-only parameters before Python 3.8 (#16481)
Summary -- Detect positional-only parameters before Python 3.8, as marked by the `/` separator in a parameter list. Test Plan -- Inline tests.
This commit is contained in:
parent
23fd4927ae
commit
d0623888b3
6 changed files with 404 additions and 0 deletions
|
@ -0,0 +1,5 @@
|
|||
# parse_options: {"target-version": "3.7"}
|
||||
def foo(a, /): ...
|
||||
def foo(a, /, b, /): ...
|
||||
def foo(a, *args, /, b): ...
|
||||
def foo(a, //): ...
|
|
@ -0,0 +1,2 @@
|
|||
# parse_options: {"target-version": "3.8"}
|
||||
def foo(a, /): ...
|
Loading…
Add table
Add a link
Reference in a new issue