gh-117613: Argument Clinic: ensure that 'defining_class' params are positional-only (#117781)

This commit is contained in:
neonene 2024-04-16 18:52:45 +09:00 • committed by GitHub
parent 1316692e8c
commit c520bf9bdf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 6 deletions

View file

@ -1102,6 +1102,7 @@ class DSLParser:
fail("A 'defining_class' parameter cannot have a default value.")
if self.group:
fail("A 'defining_class' parameter cannot be in an optional group.")
kind = inspect.Parameter.POSITIONAL_ONLY
else:
fail("A 'defining_class' parameter, if specified, must either "
"be the first thing in the parameter block, or come just "