diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-05-26 05:50:03 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-05-26 05:50:03 (GMT) |
commit | 442914d265b9752f78251e3792f5155f14a9dcc9 (patch) | |
tree | e082d523a561c348b79a36034b30f86542c3a217 /Objects | |
parent | 65b8b8483988cfdb6b23b64b77e94d87c079b9d9 (diff) | |
download | cpython-442914d265b9752f78251e3792f5155f14a9dcc9.zip cpython-442914d265b9752f78251e3792f5155f14a9dcc9.tar.gz cpython-442914d265b9752f78251e3792f5155f14a9dcc9.tar.bz2 |
Cruft cleanup: removed the #ifdef'ery in support of compiling to allow
multi-argument list.append(1, 2, 3) (as opposed to .append((1,2,3))).
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/listobject.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c index 7d0fbc1..9fb3e82 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -576,25 +576,11 @@ listinsert(PyListObject *self, PyObject *args) return ins(self, i, v); } -/* Define NO_STRICT_LIST_APPEND to enable multi-argument append() */ - -#ifndef NO_STRICT_LIST_APPEND -#define PyArg_ParseTuple_Compat1 PyArg_ParseTuple -#else -#define PyArg_ParseTuple_Compat1(args, format, ret) \ -( \ - PyTuple_GET_SIZE(args) > 1 ? (*ret = args, 1) : \ - PyTuple_GET_SIZE(args) == 1 ? (*ret = PyTuple_GET_ITEM(args, 0), 1) : \ - PyArg_ParseTuple(args, format, ret) \ -) -#endif - - static PyObject * listappend(PyListObject *self, PyObject *args) { PyObject *v; - if (!PyArg_ParseTuple_Compat1(args, "O:append", &v)) + if (!PyArg_ParseTuple(args, "O:append", &v)) return NULL; return ins(self, (int) self->ob_size, v); } @@ -1361,7 +1347,7 @@ listindex(PyListObject *self, PyObject *args) int i; PyObject *v; - if (!PyArg_ParseTuple_Compat1(args, "O:index", &v)) + if (!PyArg_ParseTuple(args, "O:index", &v)) return NULL; for (i = 0; i < self->ob_size; i++) { int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ); @@ -1381,7 +1367,7 @@ listcount(PyListObject *self, PyObject *args) int i; PyObject *v; - if (!PyArg_ParseTuple_Compat1(args, "O:count", &v)) + if (!PyArg_ParseTuple(args, "O:count", &v)) return NULL; for (i = 0; i < self->ob_size; i++) { int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ); @@ -1399,7 +1385,7 @@ listremove(PyListObject *self, PyObject *args) int i; PyObject *v; - if (!PyArg_ParseTuple_Compat1(args, "O:remove", &v)) + if (!PyArg_ParseTuple(args, "O:remove", &v)) return NULL; for (i = 0; i < self->ob_size; i++) { int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ); |