[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:
Brent Westbrook 2025-03-05 08:46:43 -05:00 committed by GitHub
parent 23fd4927ae
commit d0623888b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 404 additions and 0 deletions

View file

@ -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, //): ...

View file

@ -0,0 +1,2 @@
# parse_options: {"target-version": "3.8"}
def foo(a, /): ...