Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3570,6 +3570,18 @@ class Foo "FooObject *" "Foo_Type"
"""
self.expect_failure(block, err, lineno=7)

def test_vectorcall_with_deprecated_parameters(self):
err = "@vectorcall does not support deprecated parameters"
block = """
module m
class Foo "FooObject *" "Foo_Type"
@vectorcall
Foo.__init__
a: object = None
/ [from 3.14]
"""
self.expect_failure(block, err, lineno=5)

def test_unused_param(self):
block = self.parse("""
module foo
Expand Down
3 changes: 3 additions & 0 deletions Tools/clinic/libclinic/dsl_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,9 @@ def check_vectorcall_parameters(self, lineno: int) -> None:
if p.group:
fail("@vectorcall does not support optional groups",
line_number=lineno)
if p.deprecated_positional or p.deprecated_keyword:
fail("@vectorcall does not support deprecated parameters",
line_number=lineno)
if p.is_vararg() or p.is_var_keyword():
continue
if isinstance(p.converter, (self_converter,
Expand Down
Loading