mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +00:00
Backport METH_FASTCALL from Python 3.7 (#328)
This commit is contained in:
parent
70c97f598b
commit
cf73bbd678
102 changed files with 2896 additions and 3301 deletions
10
third_party/python/Objects/listobject.c
vendored
10
third_party/python/Objects/listobject.c
vendored
|
@ -755,12 +755,11 @@ list_ass_item(PyListObject *a, Py_ssize_t i, PyObject *v)
|
|||
}
|
||||
|
||||
static PyObject *
|
||||
listinsert(PyListObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
listinsert(PyListObject *self, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
Py_ssize_t i;
|
||||
PyObject *v;
|
||||
if (!_PyArg_ParseStack(args, nargs, "nO:insert", &i, &v)
|
||||
|| !_PyArg_NoStackKeywords("insert", kwnames))
|
||||
if (!_PyArg_ParseStack(args, nargs, "nO:insert", &i, &v))
|
||||
return NULL;
|
||||
if (ins1(self, i, v) == 0)
|
||||
Py_RETURN_NONE;
|
||||
|
@ -921,14 +920,13 @@ list_inplace_concat(PyListObject *self, PyObject *other)
|
|||
}
|
||||
|
||||
static PyObject *
|
||||
listpop(PyListObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
listpop(PyListObject *self, PyObject **args, Py_ssize_t nargs)
|
||||
{
|
||||
Py_ssize_t i = -1;
|
||||
PyObject *v;
|
||||
int status;
|
||||
|
||||
if (!_PyArg_ParseStack(args, nargs, "|n:pop", &i)
|
||||
|| !_PyArg_NoStackKeywords("pop", kwnames))
|
||||
if (!_PyArg_ParseStack(args, nargs, "|n:pop", &i))
|
||||
return NULL;
|
||||
|
||||
if (Py_SIZE(self) == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue