Skip to content

Commit c36be7c

Browse files
cmaloneyclaude
andcommitted
gh-87613: Reject deprecated parameters in AC VC
The generated vectorcall can skip the DeprecationWarning for `/ [from X.Y]` and `* [from X.Y]` parameters, so report the combination as unsupported, like optional groups. Nothing in the tree uses these. They were used in a previous sqlite3 module migration (gh-93057, gh-108278).The last ones were removed in 2023 (gh-133595) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 8e605fe commit c36be7c

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎Lib/test/test_clinic.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3570,6 +3570,18 @@ class Foo "FooObject *" "Foo_Type"
35703570
"""
35713571
self.expect_failure(block, err, lineno=7)
35723572

3573+
def test_vectorcall_with_deprecated_parameters(self):
3574+
err = "@vectorcall does not support deprecated parameters"
3575+
block = """
3576+
module m
3577+
class Foo "FooObject *" "Foo_Type"
3578+
@vectorcall
3579+
Foo.__init__
3580+
a: object = None
3581+
/ [from 3.14]
3582+
"""
3583+
self.expect_failure(block, err, lineno=5)
3584+
35733585
def test_unused_param(self):
35743586
block = self.parse("""
35753587
module foo

‎Tools/clinic/libclinic/dsl_parser.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,9 @@ def check_vectorcall_parameters(self, lineno: int) -> None:
16431643
if p.group:
16441644
fail("@vectorcall does not support optional groups",
16451645
line_number=lineno)
1646+
if p.deprecated_positional or p.deprecated_keyword:
1647+
fail("@vectorcall does not support deprecated parameters",
1648+
line_number=lineno)
16461649
if p.is_vararg() or p.is_var_keyword():
16471650
continue
16481651
if isinstance(p.converter, (self_converter,

0 commit comments

Comments
 (0)