[Python-checkins] python/dist/src/Lib sets.py,1.49,1.49.4.1

rhettinger@users.sourceforge.net rhettinger at users.sourceforge.net
Sat Aug 13 04:29:03 CEST 2005


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

Modified Files:
      Tag: release24-maint
	sets.py 
Log Message:
Teach set modules to correctly compute s-=s and s^=s as the empty set.



Index: sets.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sets.py,v
retrieving revision 1.49
retrieving revision 1.49.4.1
diff -u -d -r1.49 -r1.49.4.1
--- sets.py	19 Nov 2003 15:52:14 -0000	1.49
+++ sets.py	13 Aug 2005 02:28:53 -0000	1.49.4.1
@@ -480,6 +480,8 @@
         value = True
         if not isinstance(other, BaseSet):
             other = Set(other)
+        if self is other:
+            self.clear()
         for elt in other:
             if elt in data:
                 del data[elt]
@@ -497,6 +499,8 @@
         data = self._data
         if not isinstance(other, BaseSet):
             other = Set(other)
+        if self is other:
+            self.clear()
         for elt in ifilter(data.has_key, other):
             del data[elt]
 



More information about the Python-checkins mailing list