[Python-checkins] CVS: python/dist/src/Objects dictobject.c,2.71,2.72

Jeremy Hylton python-dev@python.org
Wed, 03 Jan 2001 14:35:01 -0800


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv2783

Modified Files:
	dictobject.c 
Log Message:
dict_update has two boundary conditions: a.update(a) and a.update({})
Added test for second one.


Index: dictobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/dictobject.c,v
retrieving revision 2.71
retrieving revision 2.72
diff -C2 -r2.71 -r2.72
*** dictobject.c	2000/12/13 23:18:45	2.71
--- dictobject.c	2001/01/03 22:34:59	2.72
***************
*** 810,815 ****
  	if (!PyArg_Parse(args, "O!", &PyDict_Type, &other))
  		return NULL;
! 	if (other == mp)
! 		goto done; /* a.update(a); nothing to do */
  	/* Do one big resize at the start, rather than incrementally
  	   resizing as we insert new items.  Expect that there will be
--- 810,815 ----
  	if (!PyArg_Parse(args, "O!", &PyDict_Type, &other))
  		return NULL;
! 	if (other == mp || other->ma_used == 0)
! 		goto done; /* a.update(a) or a.update({}); nothing to do */
  	/* Do one big resize at the start, rather than incrementally
  	   resizing as we insert new items.  Expect that there will be