mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-101409: Improve generated clinic code for self type checks (#101411)
This commit is contained in:
parent
0062f538d9
commit
2753cf2ed6
15 changed files with 80 additions and 78 deletions
7
Modules/_sqlite/clinic/cursor.c.h
generated
7
Modules/_sqlite/clinic/cursor.c.h
generated
|
@ -16,10 +16,11 @@ static int
|
|||
pysqlite_cursor_init(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
int return_value = -1;
|
||||
PyTypeObject *base_tp = clinic_state()->CursorType;
|
||||
pysqlite_Connection *connection;
|
||||
|
||||
if ((Py_IS_TYPE(self, clinic_state()->CursorType) ||
|
||||
Py_TYPE(self)->tp_new == clinic_state()->CursorType->tp_new) &&
|
||||
if ((Py_IS_TYPE(self, base_tp) ||
|
||||
Py_TYPE(self)->tp_new == base_tp->tp_new) &&
|
||||
!_PyArg_NoKeywords("Cursor", kwargs)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -318,4 +319,4 @@ pysqlite_cursor_close(pysqlite_Cursor *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return pysqlite_cursor_close_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=e53e75a32a9d92bd input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=1f82e3c9791bb9a5 input=a9049054013a1b77]*/
|
||||
|
|
6
Modules/_sqlite/clinic/row.c.h
generated
6
Modules/_sqlite/clinic/row.c.h
generated
|
@ -16,11 +16,11 @@ static PyObject *
|
|||
pysqlite_row_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyTypeObject *base_tp = clinic_state()->RowType;
|
||||
pysqlite_Cursor *cursor;
|
||||
PyObject *data;
|
||||
|
||||
if ((type == clinic_state()->RowType ||
|
||||
type->tp_init == clinic_state()->RowType->tp_init) &&
|
||||
if ((type == base_tp || type->tp_init == base_tp->tp_init) &&
|
||||
!_PyArg_NoKeywords("Row", kwargs)) {
|
||||
goto exit;
|
||||
}
|
||||
|
@ -60,4 +60,4 @@ pysqlite_row_keys(pysqlite_Row *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return pysqlite_row_keys_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=87b91f234633702e input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=157b31ac3f6af1ba input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue