Skip to content

gh-111178: Change Argument Clinic signature for METH_O #130682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 11, 2025
Merged
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
4 changes: 2 additions & 2 deletions Lib/test/clinic.test.c
Original file line number Diff line number Diff line change
Expand Up @@ -4940,7 +4940,7 @@ static int
Test_metho_not_default_return_converter_impl(TestObj *self, PyObject *a);

static PyObject *
Test_metho_not_default_return_converter(TestObj *self, PyObject *a)
Test_metho_not_default_return_converter(PyObject *self, PyObject *a)
{
PyObject *return_value = NULL;
int _return_value;
Expand All @@ -4957,7 +4957,7 @@ Test_metho_not_default_return_converter(TestObj *self, PyObject *a)

static int
Test_metho_not_default_return_converter_impl(TestObj *self, PyObject *a)
/*[clinic end generated code: output=b2cce75a7af2e6ce input=428657129b521177]*/
/*[clinic end generated code: output=8b03f5213c312138 input=428657129b521177]*/


/*[clinic input]
Expand Down
8 changes: 4 additions & 4 deletions Modules/_asynciomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2738,8 +2738,8 @@ _asyncio.Task.set_result
[clinic start generated code]*/

static PyObject *
_asyncio_Task_set_result(TaskObj *self, PyObject *result)
/*[clinic end generated code: output=1dcae308bfcba318 input=9d1a00c07be41bab]*/
_asyncio_Task_set_result_impl(TaskObj *self, PyObject *result)
/*[clinic end generated code: output=e9d8e3cdaf18e258 input=9d1a00c07be41bab]*/
{
PyErr_SetString(PyExc_RuntimeError,
"Task does not support set_result operation");
Expand All @@ -2754,8 +2754,8 @@ _asyncio.Task.set_exception
[clinic start generated code]*/

static PyObject *
_asyncio_Task_set_exception(TaskObj *self, PyObject *exception)
/*[clinic end generated code: output=bc377fc28067303d input=9a8f65c83dcf893a]*/
_asyncio_Task_set_exception_impl(TaskObj *self, PyObject *exception)
/*[clinic end generated code: output=96a91790c192cc7d input=9a8f65c83dcf893a]*/
{
PyErr_SetString(PyExc_RuntimeError,
"Task does not support set_exception operation");
Expand Down
4 changes: 2 additions & 2 deletions Modules/_collectionsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ deque_extend_impl(dequeobject *deque, PyObject *iterable)
PyObject *s = PySequence_List(iterable);
if (s == NULL)
return NULL;
result = deque_extend(deque, s);
result = deque_extend((PyObject*)deque, s);
Py_DECREF(s);
return result;
}
Expand Down Expand Up @@ -578,7 +578,7 @@ deque_inplace_concat(PyObject *self, PyObject *other)
PyObject *result;

// deque_extend is thread-safe
result = deque_extend(deque, other);
result = deque_extend((PyObject*)deque, other);
if (result == NULL)
return result;
Py_INCREF(deque);
Expand Down
4 changes: 2 additions & 2 deletions Modules/_cursesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2309,8 +2309,8 @@ This information can be later retrieved using the getwin() function.
[clinic start generated code]*/

static PyObject *
_curses_window_putwin(PyCursesWindowObject *self, PyObject *file)
/*[clinic end generated code: output=3a25e2a5e7a040ac input=0608648e09c8ea0a]*/
_curses_window_putwin_impl(PyCursesWindowObject *self, PyObject *file)
/*[clinic end generated code: output=fdae68ac59b0281b input=0608648e09c8ea0a]*/
{
/* We have to simulate this by writing to a temporary FILE*,
then reading back, then writing to the argument file. */
Expand Down
22 changes: 12 additions & 10 deletions Modules/_elementtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2951,8 +2951,8 @@ _elementtree.TreeBuilder.data
[clinic start generated code]*/

static PyObject *
_elementtree_TreeBuilder_data(TreeBuilderObject *self, PyObject *data)
/*[clinic end generated code: output=69144c7100795bb2 input=a0540c532b284d29]*/
_elementtree_TreeBuilder_data_impl(TreeBuilderObject *self, PyObject *data)
/*[clinic end generated code: output=dfa02b68f732b8c0 input=a0540c532b284d29]*/
{
return treebuilder_handle_data(self, data);
}
Expand All @@ -2966,8 +2966,8 @@ _elementtree.TreeBuilder.end
[clinic start generated code]*/

static PyObject *
_elementtree_TreeBuilder_end(TreeBuilderObject *self, PyObject *tag)
/*[clinic end generated code: output=9a98727cc691cd9d input=22dc3674236f5745]*/
_elementtree_TreeBuilder_end_impl(TreeBuilderObject *self, PyObject *tag)
/*[clinic end generated code: output=84cb6ca9008ec740 input=22dc3674236f5745]*/
{
return treebuilder_handle_end(self, tag);
}
Expand All @@ -2981,8 +2981,9 @@ _elementtree.TreeBuilder.comment
[clinic start generated code]*/

static PyObject *
_elementtree_TreeBuilder_comment(TreeBuilderObject *self, PyObject *text)
/*[clinic end generated code: output=22835be41deeaa27 input=47e7ebc48ed01dfa]*/
_elementtree_TreeBuilder_comment_impl(TreeBuilderObject *self,
PyObject *text)
/*[clinic end generated code: output=a555ef39027c3823 input=47e7ebc48ed01dfa]*/
{
return treebuilder_handle_comment(self, text);
}
Expand Down Expand Up @@ -3949,8 +3950,8 @@ _elementtree.XMLParser.feed
[clinic start generated code]*/

static PyObject *
_elementtree_XMLParser_feed(XMLParserObject *self, PyObject *data)
/*[clinic end generated code: output=e42b6a78eec7446d input=fe231b6b8de3ce1f]*/
_elementtree_XMLParser_feed_impl(XMLParserObject *self, PyObject *data)
/*[clinic end generated code: output=503e6fbf1adf17ab input=fe231b6b8de3ce1f]*/
{
/* feed data to parser */

Expand Down Expand Up @@ -3997,8 +3998,9 @@ _elementtree.XMLParser._parse_whole
[clinic start generated code]*/

static PyObject *
_elementtree_XMLParser__parse_whole(XMLParserObject *self, PyObject *file)
/*[clinic end generated code: output=f797197bb818dda3 input=19ecc893b6f3e752]*/
_elementtree_XMLParser__parse_whole_impl(XMLParserObject *self,
PyObject *file)
/*[clinic end generated code: output=60718a4e63d237d2 input=19ecc893b6f3e752]*/
{
/* (internal) parse the whole input, until end of stream */
PyObject* reader;
Expand Down
4 changes: 2 additions & 2 deletions Modules/_hashopenssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,8 @@ Update this hash object's state with the provided string.
[clinic start generated code]*/

static PyObject *
EVP_update(EVPobject *self, PyObject *obj)
/*[clinic end generated code: output=ec1d55ed2432e966 input=9b30ec848f015501]*/
EVP_update_impl(EVPobject *self, PyObject *obj)
/*[clinic end generated code: output=d56f91c68348f95f input=9b30ec848f015501]*/
{
int result;
Py_buffer view;
Expand Down
6 changes: 3 additions & 3 deletions Modules/_io/bufferedio.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,8 @@ _io._Buffered._dealloc_warn
[clinic start generated code]*/

static PyObject *
_io__Buffered__dealloc_warn(buffered *self, PyObject *source)
/*[clinic end generated code: output=690dcc3df8967162 input=8f845f2a4786391c]*/
_io__Buffered__dealloc_warn_impl(buffered *self, PyObject *source)
/*[clinic end generated code: output=d8db21c6dec0e614 input=8f845f2a4786391c]*/
{
if (self->ok && self->raw) {
PyObject *r;
Expand Down Expand Up @@ -560,7 +560,7 @@ _io__Buffered_close_impl(buffered *self)
}

if (self->finalizing) {
PyObject *r = _io__Buffered__dealloc_warn(self, (PyObject *) self);
PyObject *r = _io__Buffered__dealloc_warn_impl(self, (PyObject *)self);
if (r)
Py_DECREF(r);
else
Expand Down
12 changes: 6 additions & 6 deletions Modules/_io/bytesio.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,8 @@ Return the number of bytes written.
[clinic start generated code]*/

static PyObject *
_io_BytesIO_write(bytesio *self, PyObject *b)
/*[clinic end generated code: output=53316d99800a0b95 input=f5ec7c8c64ed720a]*/
_io_BytesIO_write_impl(bytesio *self, PyObject *b)
/*[clinic end generated code: output=d3e46bcec8d9e21c input=f5ec7c8c64ed720a]*/
{
Py_ssize_t n = write_bytes(self, b);
return n >= 0 ? PyLong_FromSsize_t(n) : NULL;
Expand All @@ -730,8 +730,8 @@ each element.
[clinic start generated code]*/

static PyObject *
_io_BytesIO_writelines(bytesio *self, PyObject *lines)
/*[clinic end generated code: output=7f33aa3271c91752 input=e972539176fc8fc1]*/
_io_BytesIO_writelines_impl(bytesio *self, PyObject *lines)
/*[clinic end generated code: output=03a43a75773bc397 input=e972539176fc8fc1]*/
{
PyObject *it, *item;

Expand Down Expand Up @@ -842,7 +842,7 @@ bytesio_setstate(PyObject *op, PyObject *state)

/* Set the value of the internal buffer. If state[0] does not support the
buffer protocol, bytesio_write will raise the appropriate TypeError. */
result = _io_BytesIO_write(self, PyTuple_GET_ITEM(state, 0));
result = _io_BytesIO_write_impl(self, PyTuple_GET_ITEM(state, 0));
if (result == NULL)
return NULL;
Py_DECREF(result);
Expand Down Expand Up @@ -958,7 +958,7 @@ _io_BytesIO___init___impl(bytesio *self, PyObject *initvalue)
}
else {
PyObject *res;
res = _io_BytesIO_write(self, initvalue);
res = _io_BytesIO_write_impl(self, initvalue);
if (res == NULL)
return -1;
Py_DECREF(res);
Expand Down
15 changes: 14 additions & 1 deletion Modules/_io/clinic/bufferedio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 27 additions & 1 deletion Modules/_io/clinic/bytesio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Modules/_io/clinic/stringio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion Modules/_io/clinic/textio.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Modules/_io/textio.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,9 @@ _io.IncrementalNewlineDecoder.setstate
[clinic start generated code]*/

static PyObject *
_io_IncrementalNewlineDecoder_setstate(nldecoder_object *self,
PyObject *state)
/*[clinic end generated code: output=c10c622508b576cb input=c53fb505a76dbbe2]*/
_io_IncrementalNewlineDecoder_setstate_impl(nldecoder_object *self,
PyObject *state)
/*[clinic end generated code: output=09135cb6e78a1dc8 input=c53fb505a76dbbe2]*/
{
PyObject *buffer;
unsigned long long flag;
Expand Down
16 changes: 15 additions & 1 deletion Modules/_sqlite/clinic/connection.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion Modules/_sqlite/clinic/cursor.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Modules/_sqlite/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1908,9 +1908,9 @@ Executes multiple SQL statements at once.
[clinic start generated code]*/

static PyObject *
pysqlite_connection_executescript(pysqlite_Connection *self,
PyObject *script_obj)
/*[clinic end generated code: output=4c4f9d77aa0ae37d input=f6e5f1ccfa313db4]*/
pysqlite_connection_executescript_impl(pysqlite_Connection *self,
PyObject *script_obj)
/*[clinic end generated code: output=e921c49e2291782c input=f6e5f1ccfa313db4]*/
{
PyObject* result = 0;

Expand Down
Loading
Loading