[Python-checkins] CVS: python/dist/src/Misc NEWS,1.84,1.85

Guido van Rossum python-dev@python.org
Tue, 12 Dec 2000 14:10:35 -0800


Update of /cvsroot/python/python/dist/src/Misc
In directory slayer.i.sourceforge.net:/tmp/cvs-serv11662

Modified Files:
	NEWS 
Log Message:
Describe {}.popitem().


Index: NEWS
===================================================================
RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v
retrieving revision 1.84
retrieving revision 1.85
diff -C2 -r1.84 -r1.85
*** NEWS	2000/12/12 01:18:39	1.84
--- NEWS	2000/12/12 22:10:31	1.85
***************
*** 28,31 ****
--- 28,38 ----
    via %u raised an error if it was too big to fit in an int.
  
+ - Dictionary objects have an odd new method, popitem().  This removes
+   an arbitrary item from the dictionary and returns it (in the form of
+   a (key, value) pair).  This can be useful for algorithms that use a
+   dictionary as a bag of "to do" items and repeatedly need to pick one
+   item.  Such algorithms normally end up running in quadratic time;
+   using popitem() they can usually be made to run in linear time.
+ 
  Windows changes