Skip to content

Commit 537296c

Browse files
authoredJan 20, 2025
pythongh-111178: Generate correct signature for most self converters (python#128447)
1 parent 4d0a659 commit 537296c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1627
-1631
lines changed
 

‎Lib/test/clinic.test.c

+29-29
Original file line numberDiff line numberDiff line change
@@ -4758,7 +4758,7 @@ static PyObject *
47584758
Test_cls_with_param_impl(TestObj *self, PyTypeObject *cls, int a);
47594759

47604760
static PyObject *
4761-
Test_cls_with_param(TestObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
4761+
Test_cls_with_param(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
47624762
{
47634763
PyObject *return_value = NULL;
47644764
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
@@ -4798,15 +4798,15 @@ Test_cls_with_param(TestObj *self, PyTypeObject *cls, PyObject *const *args, Py_
47984798
if (a == -1 && PyErr_Occurred()) {
47994799
goto exit;
48004800
}
4801-
return_value = Test_cls_with_param_impl(self, cls, a);
4801+
return_value = Test_cls_with_param_impl((TestObj *)self, cls, a);
48024802

48034803
exit:
48044804
return return_value;
48054805
}
48064806

48074807
static PyObject *
48084808
Test_cls_with_param_impl(TestObj *self, PyTypeObject *cls, int a)
4809-
/*[clinic end generated code: output=83a391eea66d08f8 input=af158077bd237ef9]*/
4809+
/*[clinic end generated code: output=7e893134a81fef92 input=af158077bd237ef9]*/
48104810

48114811

48124812
/*[clinic input]
@@ -4908,18 +4908,18 @@ static PyObject *
49084908
Test_cls_no_params_impl(TestObj *self, PyTypeObject *cls);
49094909

49104910
static PyObject *
4911-
Test_cls_no_params(TestObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
4911+
Test_cls_no_params(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
49124912
{
49134913
if (nargs || (kwnames && PyTuple_GET_SIZE(kwnames))) {
49144914
PyErr_SetString(PyExc_TypeError, "cls_no_params() takes no arguments");
49154915
return NULL;
49164916
}
4917-
return Test_cls_no_params_impl(self, cls);
4917+
return Test_cls_no_params_impl((TestObj *)self, cls);
49184918
}
49194919

49204920
static PyObject *
49214921
Test_cls_no_params_impl(TestObj *self, PyTypeObject *cls)
4922-
/*[clinic end generated code: output=4d68b4652c144af3 input=e7e2e4e344e96a11]*/
4922+
/*[clinic end generated code: output=8845de054449f40a input=e7e2e4e344e96a11]*/
49234923

49244924

49254925
/*[clinic input]
@@ -4945,7 +4945,7 @@ Test_metho_not_default_return_converter(TestObj *self, PyObject *a)
49454945
PyObject *return_value = NULL;
49464946
int _return_value;
49474947

4948-
_return_value = Test_metho_not_default_return_converter_impl(self, a);
4948+
_return_value = Test_metho_not_default_return_converter_impl((TestObj *)self, a);
49494949
if ((_return_value == -1) && PyErr_Occurred()) {
49504950
goto exit;
49514951
}
@@ -4957,7 +4957,7 @@ Test_metho_not_default_return_converter(TestObj *self, PyObject *a)
49574957

49584958
static int
49594959
Test_metho_not_default_return_converter_impl(TestObj *self, PyObject *a)
4960-
/*[clinic end generated code: output=3350de11bd538007 input=428657129b521177]*/
4960+
/*[clinic end generated code: output=b2cce75a7af2e6ce input=428657129b521177]*/
49614961

49624962

49634963
/*[clinic input]
@@ -4983,7 +4983,7 @@ static PyObject *
49834983
Test_an_metho_arg_named_arg_impl(TestObj *self, int arg);
49844984

49854985
static PyObject *
4986-
Test_an_metho_arg_named_arg(TestObj *self, PyObject *arg_)
4986+
Test_an_metho_arg_named_arg(PyObject *self, PyObject *arg_)
49874987
{
49884988
PyObject *return_value = NULL;
49894989
int arg;
@@ -4992,15 +4992,15 @@ Test_an_metho_arg_named_arg(TestObj *self, PyObject *arg_)
49924992
if (arg == -1 && PyErr_Occurred()) {
49934993
goto exit;
49944994
}
4995-
return_value = Test_an_metho_arg_named_arg_impl(self, arg);
4995+
return_value = Test_an_metho_arg_named_arg_impl((TestObj *)self, arg);
49964996

49974997
exit:
49984998
return return_value;
49994999
}
50005000

50015001
static PyObject *
50025002
Test_an_metho_arg_named_arg_impl(TestObj *self, int arg)
5003-
/*[clinic end generated code: output=9f04de4a62287e28 input=2a53a57cf5624f95]*/
5003+
/*[clinic end generated code: output=38554f09950d07e7 input=2a53a57cf5624f95]*/
50045004

50055005

50065006
/*[clinic input]
@@ -5289,14 +5289,14 @@ static PyObject *
52895289
Test_meth_coexist_impl(TestObj *self);
52905290

52915291
static PyObject *
5292-
Test_meth_coexist(TestObj *self, PyObject *Py_UNUSED(ignored))
5292+
Test_meth_coexist(PyObject *self, PyObject *Py_UNUSED(ignored))
52935293
{
5294-
return Test_meth_coexist_impl(self);
5294+
return Test_meth_coexist_impl((TestObj *)self);
52955295
}
52965296

52975297
static PyObject *
52985298
Test_meth_coexist_impl(TestObj *self)
5299-
/*[clinic end generated code: output=808a293d0cd27439 input=2a1d75b5e6fec6dd]*/
5299+
/*[clinic end generated code: output=7edf4e95b29f06fa input=2a1d75b5e6fec6dd]*/
53005300

53015301
/*[clinic input]
53025302
@getter
@@ -5317,14 +5317,14 @@ static PyObject *
53175317
Test_property_get_impl(TestObj *self);
53185318

53195319
static PyObject *
5320-
Test_property_get(TestObj *self, void *Py_UNUSED(context))
5320+
Test_property_get(PyObject *self, void *Py_UNUSED(context))
53215321
{
5322-
return Test_property_get_impl(self);
5322+
return Test_property_get_impl((TestObj *)self);
53235323
}
53245324

53255325
static PyObject *
53265326
Test_property_get_impl(TestObj *self)
5327-
/*[clinic end generated code: output=7cadd0f539805266 input=2d92b3449fbc7d2b]*/
5327+
/*[clinic end generated code: output=b38d68abd3466a6e input=2d92b3449fbc7d2b]*/
53285328

53295329
/*[clinic input]
53305330
@setter
@@ -5345,18 +5345,18 @@ static int
53455345
Test_property_set_impl(TestObj *self, PyObject *value);
53465346

53475347
static int
5348-
Test_property_set(TestObj *self, PyObject *value, void *Py_UNUSED(context))
5348+
Test_property_set(PyObject *self, PyObject *value, void *Py_UNUSED(context))
53495349
{
53505350
int return_value;
53515351

5352-
return_value = Test_property_set_impl(self, value);
5352+
return_value = Test_property_set_impl((TestObj *)self, value);
53535353

53545354
return return_value;
53555355
}
53565356

53575357
static int
53585358
Test_property_set_impl(TestObj *self, PyObject *value)
5359-
/*[clinic end generated code: output=e4342fe9bb1d7817 input=3bc3f46a23c83a88]*/
5359+
/*[clinic end generated code: output=49f925ab2a33b637 input=3bc3f46a23c83a88]*/
53605360

53615361
/*[clinic input]
53625362
@setter
@@ -5377,18 +5377,18 @@ static int
53775377
Test_setter_first_with_docstr_set_impl(TestObj *self, PyObject *value);
53785378

53795379
static int
5380-
Test_setter_first_with_docstr_set(TestObj *self, PyObject *value, void *Py_UNUSED(context))
5380+
Test_setter_first_with_docstr_set(PyObject *self, PyObject *value, void *Py_UNUSED(context))
53815381
{
53825382
int return_value;
53835383

5384-
return_value = Test_setter_first_with_docstr_set_impl(self, value);
5384+
return_value = Test_setter_first_with_docstr_set_impl((TestObj *)self, value);
53855385

53865386
return return_value;
53875387
}
53885388

53895389
static int
53905390
Test_setter_first_with_docstr_set_impl(TestObj *self, PyObject *value)
5391-
/*[clinic end generated code: output=e4d76b558a4061db input=31a045ce11bbe961]*/
5391+
/*[clinic end generated code: output=5aaf44373c0af545 input=31a045ce11bbe961]*/
53925392

53935393
/*[clinic input]
53945394
@getter
@@ -5418,14 +5418,14 @@ static PyObject *
54185418
Test_setter_first_with_docstr_get_impl(TestObj *self);
54195419

54205420
static PyObject *
5421-
Test_setter_first_with_docstr_get(TestObj *self, void *Py_UNUSED(context))
5421+
Test_setter_first_with_docstr_get(PyObject *self, void *Py_UNUSED(context))
54225422
{
5423-
return Test_setter_first_with_docstr_get_impl(self);
5423+
return Test_setter_first_with_docstr_get_impl((TestObj *)self);
54245424
}
54255425

54265426
static PyObject *
54275427
Test_setter_first_with_docstr_get_impl(TestObj *self)
5428-
/*[clinic end generated code: output=749a30266f9fb443 input=10af4e43b3cb34dc]*/
5428+
/*[clinic end generated code: output=fe6e3aa844a24920 input=10af4e43b3cb34dc]*/
54295429

54305430
/*[clinic input]
54315431
output push
@@ -5708,7 +5708,7 @@ Test__pyarg_parsestackandkeywords_impl(TestObj *self, PyTypeObject *cls,
57085708
Py_ssize_t key_length);
57095709

57105710
static PyObject *
5711-
Test__pyarg_parsestackandkeywords(TestObj *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
5711+
Test__pyarg_parsestackandkeywords(PyObject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
57125712
{
57135713
PyObject *return_value = NULL;
57145714
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
@@ -5731,7 +5731,7 @@ Test__pyarg_parsestackandkeywords(TestObj *self, PyTypeObject *cls, PyObject *co
57315731
&key, &key_length)) {
57325732
goto exit;
57335733
}
5734-
return_value = Test__pyarg_parsestackandkeywords_impl(self, cls, key, key_length);
5734+
return_value = Test__pyarg_parsestackandkeywords_impl((TestObj *)self, cls, key, key_length);
57355735

57365736
exit:
57375737
return return_value;
@@ -5741,7 +5741,7 @@ static PyObject *
57415741
Test__pyarg_parsestackandkeywords_impl(TestObj *self, PyTypeObject *cls,
57425742
const char *key,
57435743
Py_ssize_t key_length)
5744-
/*[clinic end generated code: output=4fda8a7f2547137c input=fc72ef4b4cfafabc]*/
5744+
/*[clinic end generated code: output=7060c213d7b8200e input=fc72ef4b4cfafabc]*/
57455745

57465746

57475747
/*[clinic input]

‎Modules/_ctypes/clinic/_ctypes.c.h

+15-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.