Re: [Python-checkins] python/dist/src/Objects listobject.c, 2.182, 2.183

Feb. 19, 2004
2:24 a.m.
On Tue, Feb 17, 2004 at 03:36:19AM -0800, rhettinger@users.sourceforge.net wrote:
{ ! PyObject *v; ! if (!PyArg_ParseTuple(args, "|i:pop", &i)) return NULL; --- 773,788 ---- { ! PyObject *v, *arg = NULL; ! ! if (!PyArg_UnpackTuple(args, "pop", 0, 1, &arg)) return NULL; + 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; + } + }
This is a change in behaviour. This used to work:
x = [1,2,3] x.pop(1L) Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: an integer is required
7765
Age (days ago)
7765
Last active (days ago)
0 comments
1 participants
participants (1)
-
Neal Norwitz