[Python-checkins] python/dist/src/Objects typeobject.c,2.244,2.245

gvanrossum at users.sourceforge.net gvanrossum at users.sourceforge.net
Wed Oct 8 17:05:41 EDT 2003


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1:/tmp/cvs-serv28149
Modified Files:
	typeobject.c 
Log Message:
SF patch #820195 by Wojtek Walczak (gminick at users.sourceforge.net):
make obj.__contains__() returns True/False instead of 1/0.
Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.244
retrieving revision 2.245
diff -C2 -d -r2.244 -r2.245
*** typeobject.c	15 Aug 2003 13:07:46 -0000	2.244
--- typeobject.c	8 Oct 2003 21:05:38 -0000	2.245
***************
*** 3570,3574 ****
 	objobjproc func = (objobjproc)wrapped;
 	int res;
! 	PyObject *value;
 
 	if (!PyArg_ParseTuple(args, "O", &value))
--- 3570,3574 ----
 	objobjproc func = (objobjproc)wrapped;
 	int res;
! 	PyObject *value, *ret;
 
 	if (!PyArg_ParseTuple(args, "O", &value))
***************
*** 3577,3581 ****
 	if (res == -1 && PyErr_Occurred())
 		return NULL;
! 	return PyInt_FromLong((long)res);
 }
 
--- 3577,3583 ----
 	if (res == -1 && PyErr_Occurred())
 		return NULL;
! 	ret = PyObject_IsTrue(PyInt_FromLong((long)res)) ? Py_True : Py_False;
! 	Py_INCREF(ret);
! 	return ret;
 }
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /