[Python-checkins] python/dist/src/Objects enumobject.c,1.10,1.11

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Fri Feb 6 21:45:24 EST 2004


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

Modified Files:
	enumobject.c 
Log Message:
* Fix ref counting in extend() and extendleft().
* Let deques support reversed().



Index: enumobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/enumobject.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** enumobject.c	7 Nov 2003 15:38:08 -0000	1.10
--- enumobject.c	7 Feb 2004 02:45:22 -0000	1.11
***************
*** 175,180 ****
  		return NULL;
  
! 	/* Special case optimization for xrange and lists */
! 	if (PyRange_Check(seq) || PyList_Check(seq))
  		return PyObject_CallMethod(seq, "__reversed__", NULL);
  
--- 175,179 ----
  		return NULL;
  
! 	if (PyObject_HasAttrString(seq, "__reversed__"))
  		return PyObject_CallMethod(seq, "__reversed__", NULL);
  




More information about the Python-checkins mailing list