mirror of
https://github.com/python/cpython
synced 2026-09-28 05:13:17 +03:00
gh-117613: Argument Clinic: disallow defining class parameter at module level (#117950)
This commit is contained in:
parent
a4b44d39cd
commit
c1d7147c82
2 changed files with 11 additions and 0 deletions
|
|
@ -1102,6 +1102,8 @@ 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.")
|
||||
if self.function.cls is None:
|
||||
fail("A 'defining_class' parameter cannot be defined at module level.")
|
||||
kind = inspect.Parameter.POSITIONAL_ONLY
|
||||
else:
|
||||
fail("A 'defining_class' parameter, if specified, must either "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue