[Lxml-checkins] r47079 - lxml/trunk/src/lxml/html

ianb at codespeak.net ianb at codespeak.net
Tue Oct 2 00:24:09 CEST 2007


Author: ianb
Date: Tue Oct  2 00:24:07 2007
New Revision: 47079

Modified:
   lxml/trunk/src/lxml/html/setmixin.py
Log:
fix the in-place operators in SetMixin

Modified: lxml/trunk/src/lxml/html/setmixin.py
==============================================================================
--- lxml/trunk/src/lxml/html/setmixin.py	(original)
+++ lxml/trunk/src/lxml/html/setmixin.py	Tue Oct  2 00:24:07 2007
@@ -71,21 +71,27 @@
         for item in other:
             self.add(item)
 
-    __ior__ = update
+    def __ior__(self, other):
+        self.update(other)
+        return self
 
     def intersection_update(self, other):
         for item in self:
             if item not in other:
                 self.remove(item)
 
-    __iand__ = intersection_update
+    def __iand__(self, other):
+        self.intersection_update(other)
+        return self
 
     def difference_update(self, other):
         for item in other:
             if item in self:
                 self.remove(item)
 
-    __isub__ = difference_update
+    def __isub__(self, other):
+        self.difference_update(other)
+        return self
 
     def symmetric_difference_update(self, other):
         for item in other:
@@ -94,7 +100,9 @@
             else:
                 self.add(item)
 
-    __ixor__ = symmetric_difference_update
+    def __ixor__(self, other):
+        self.symmetric_difference_update(other)
+        return self
 
     def discard(self, item):
         try:


More information about the lxml-checkins mailing list