mirror of
https://github.com/astral-sh/ruff
synced 2026-01-09 15:44:22 -05: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:
@@ -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, /): ...
|
||||
Reference in New Issue
Block a user