Skip to content

Commit 06a8b0b

Browse files
gh-122943: Remove the object converter for var-positional parameter (GH-126560)
1 parent c222441 commit 06a8b0b

File tree

7 files changed

+80
-87
lines changed

7 files changed

+80
-87
lines changed

Lib/test/clinic.test.c

+12-12
Original file line numberDiff line numberDiff line change
@@ -4135,7 +4135,7 @@ test_vararg_and_posonly
41354135
41364136
a: object
41374137
/
4138-
*args: object
4138+
*args: tuple
41394139
41404140
[clinic start generated code]*/
41414141

@@ -4176,7 +4176,7 @@ test_vararg_and_posonly(PyObject *module, PyObject *const *args, Py_ssize_t narg
41764176

41774177
static PyObject *
41784178
test_vararg_and_posonly_impl(PyObject *module, PyObject *a, PyObject *args)
4179-
/*[clinic end generated code: output=0c11c475e240869e input=9cfa748bbff09877]*/
4179+
/*[clinic end generated code: output=0c11c475e240869e input=2c49a482f68545c0]*/
41804180

41814181
PyDoc_STRVAR(test_vararg_and_posonly__doc__,
41824182
"test_vararg_and_posonly($module, a, /, *args)\n"
@@ -4221,7 +4221,7 @@ test_vararg
42214221
42224222
42234223
a: object
4224-
*args: object
4224+
*args: tuple
42254225
42264226
[clinic start generated code]*/
42274227

@@ -4292,14 +4292,14 @@ test_vararg(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject
42924292

42934293
static PyObject *
42944294
test_vararg_impl(PyObject *module, PyObject *a, PyObject *args)
4295-
/*[clinic end generated code: output=e7d7da6a7e008125 input=81d33815ad1bae6e]*/
4295+
/*[clinic end generated code: output=e7d7da6a7e008125 input=7448995636d9186a]*/
42964296

42974297
/*[clinic input]
42984298
test_vararg_with_default
42994299
43004300
43014301
a: object
4302-
*args: object
4302+
*args: tuple
43034303
b: bool = False
43044304
43054305
[clinic start generated code]*/
@@ -4383,13 +4383,13 @@ test_vararg_with_default(PyObject *module, PyObject *const *args, Py_ssize_t nar
43834383
static PyObject *
43844384
test_vararg_with_default_impl(PyObject *module, PyObject *a, PyObject *args,
43854385
int b)
4386-
/*[clinic end generated code: output=46781f9920ecedcf input=6e110b54acd9b22d]*/
4386+
/*[clinic end generated code: output=46781f9920ecedcf input=3a0f9f557ce1f712]*/
43874387

43884388
/*[clinic input]
43894389
test_vararg_with_only_defaults
43904390
43914391
4392-
*args: object
4392+
*args: tuple
43934393
b: bool = False
43944394
c: object = ' '
43954395
@@ -4477,7 +4477,7 @@ test_vararg_with_only_defaults(PyObject *module, PyObject *const *args, Py_ssize
44774477
static PyObject *
44784478
test_vararg_with_only_defaults_impl(PyObject *module, PyObject *args, int b,
44794479
PyObject *c)
4480-
/*[clinic end generated code: output=d03daf5067039c03 input=fa56a709a035666e]*/
4480+
/*[clinic end generated code: output=d03daf5067039c03 input=6983e66817f82924]*/
44814481

44824482
/*[clinic input]
44834483
test_paramname_module
@@ -4978,7 +4978,7 @@ Test_an_metho_arg_named_arg_impl(TestObj *self, int arg)
49784978

49794979
/*[clinic input]
49804980
Test.__init__
4981-
*args: object
4981+
*args: tuple
49824982
49834983
Varargs init method. For example, nargs is translated to PyTuple_GET_SIZE.
49844984
[clinic start generated code]*/
@@ -5016,7 +5016,7 @@ Test___init__(PyObject *self, PyObject *args, PyObject *kwargs)
50165016

50175017
static int
50185018
Test___init___impl(TestObj *self, PyObject *args)
5019-
/*[clinic end generated code: output=f172425cec373cd6 input=2a8bd0033c9ac772]*/
5019+
/*[clinic end generated code: output=f172425cec373cd6 input=4b8388c4e6baab6f]*/
50205020

50215021
PyDoc_STRVAR(Test___init____doc__,
50225022
"Test(*args)\n"
@@ -5054,7 +5054,7 @@ Test___init__(PyObject *self, PyObject *args, PyObject *kwargs)
50545054
/*[clinic input]
50555055
@classmethod
50565056
Test.__new__
5057-
*args: object
5057+
*args: tuple
50585058
50595059
Varargs new method. For example, nargs is translated to PyTuple_GET_SIZE.
50605060
[clinic start generated code]*/
@@ -5091,7 +5091,7 @@ Test(PyTypeObject *type, PyObject *args, PyObject *kwargs)
50915091

50925092
static PyObject *
50935093
Test_impl(PyTypeObject *type, PyObject *args)
5094-
/*[clinic end generated code: output=ee1e8892a67abd4a input=70ad829df3dd9b84]*/
5094+
/*[clinic end generated code: output=ee1e8892a67abd4a input=a8259521129cad20]*/
50955095

50965096
PyDoc_STRVAR(Test__doc__,
50975097
"Test(*args)\n"

Lib/test/test_clinic.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def test_star_after_vararg(self):
338338
my_test_func
339339
340340
pos_arg: object
341-
*args: object
341+
*args: tuple
342342
*
343343
kw_arg: object
344344
[clinic start generated code]*/
@@ -353,7 +353,7 @@ def test_vararg_after_star(self):
353353
354354
pos_arg: object
355355
*
356-
*args: object
356+
*args: tuple
357357
kw_arg: object
358358
[clinic start generated code]*/
359359
"""
@@ -1816,7 +1816,7 @@ def test_parameters_required_after_depr_star3(self):
18161816
foo.bar
18171817
a: int
18181818
* [from 3.14]
1819-
*args: object
1819+
*args: tuple
18201820
b: int
18211821
Docstring.
18221822
"""
@@ -1844,7 +1844,7 @@ def test_depr_star_must_come_before_vararg(self):
18441844
module foo
18451845
foo.bar
18461846
a: int
1847-
*args: object
1847+
*args: tuple
18481848
* [from 3.14]
18491849
b: int
18501850
Docstring.
@@ -1980,7 +1980,7 @@ def test_slash_after_vararg(self):
19801980
foo.bar
19811981
x: int
19821982
y: int
1983-
*args: object
1983+
*args: tuple
19841984
z: int
19851985
/
19861986
"""
@@ -2031,7 +2031,7 @@ def test_vararg_must_come_after_depr_slash(self):
20312031
module foo
20322032
foo.bar
20332033
a: int
2034-
*args: object
2034+
*args: tuple
20352035
/ [from 3.14]
20362036
b: int
20372037
Docstring.
@@ -2070,8 +2070,8 @@ def test_parameters_no_more_than_one_vararg(self):
20702070
block = """
20712071
module foo
20722072
foo.bar
2073-
*vararg1: object
2074-
*vararg2: object
2073+
*vararg1: tuple
2074+
*vararg2: tuple
20752075
"""
20762076
self.expect_failure(block, err, lineno=3)
20772077

@@ -2156,11 +2156,11 @@ def test_indent_stack_no_tabs(self):
21562156
block = """
21572157
module foo
21582158
foo.bar
2159-
*vararg1: object
2160-
\t*vararg2: object
2159+
*vararg1: tuple
2160+
\t*vararg2: tuple
21612161
"""
21622162
err = ("Tab characters are illegal in the Clinic DSL: "
2163-
r"'\t*vararg2: object'")
2163+
r"'\t*vararg2: tuple'")
21642164
self.expect_failure(block, err)
21652165

21662166
def test_indent_stack_illegal_outdent(self):
@@ -2505,7 +2505,7 @@ def test_vararg_cannot_take_default_value(self):
25052505
err = "Vararg can't take a default value!"
25062506
block = """
25072507
fn
2508-
*args: object = None
2508+
*args: tuple = None
25092509
"""
25102510
self.expect_failure(block, err, lineno=1)
25112511

0 commit comments

Comments
 (0)