[Python-checkins] python/dist/src/Objects listobject.c,2.183,2.184

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Thu Feb 19 01:12:09 EST 2004


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11253

Modified Files:
	listobject.c 
Log Message:
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.)



Index: listobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v
retrieving revision 2.183
retrieving revision 2.184
diff -C2 -d -r2.183 -r2.184
*** listobject.c	17 Feb 2004 11:36:16 -0000	2.183
--- listobject.c	19 Feb 2004 06:12:06 -0000	2.184
***************
*** 780,787 ****
  		if (PyInt_Check(arg))
  			i = (int)(PyInt_AS_LONG((PyIntObject*) arg));
! 		else {
! 			PyErr_SetString(PyExc_TypeError, "an integer is required");
! 			return NULL;
! 		}
  	}
  	if (self->ob_size == 0) {
--- 780,785 ----
  		if (PyInt_Check(arg))
  			i = (int)(PyInt_AS_LONG((PyIntObject*) arg));
! 		else if (!PyArg_ParseTuple(args, "|i:pop", &i))
!    			return NULL;
  	}
  	if (self->ob_size == 0) {




More information about the Python-checkins mailing list