Commit fa6c6f8a authored by Raymond Hettinger's avatar Raymond Hettinger

Keep the list.pop() optimization while restoring the many possibility

for types other than PyInt being accepted for the optional argument.
(Spotted by Neal Norwitz.)
parent 44dbae8c
......@@ -779,10 +779,8 @@ listpop(PyListObject *self, PyObject *args)
if (arg != NULL) {
if (PyInt_Check(arg))
i = (int)(PyInt_AS_LONG((PyIntObject*) arg));
else {
PyErr_SetString(PyExc_TypeError, "an integer is required");
return NULL;
}
else if (!PyArg_ParseTuple(args, "|i:pop", &i))
return NULL;
}
if (self->ob_size == 0) {
/* Special-case most common failure cause */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment