[Python-checkins] r60431 - python/trunk/Lib/_abcoll.py

raymond.hettinger python-checkins at python.org
Wed Jan 30 01:01:08 CET 2008


Author: raymond.hettinger
Date: Wed Jan 30 01:01:07 2008
New Revision: 60431

Modified:
   python/trunk/Lib/_abcoll.py
Log:
Add isdisjoint() to the Set/MutableSet ABCs.

Modified: python/trunk/Lib/_abcoll.py
==============================================================================
--- python/trunk/Lib/_abcoll.py	(original)
+++ python/trunk/Lib/_abcoll.py	Wed Jan 30 01:01:07 2008
@@ -177,6 +177,12 @@
             return NotImplemented
         return self._from_iterable(value for value in other if value in self)
 
+    def isdisjoint(self, other):
+        for value in other:
+            if value in self:
+                return False
+        return True
+
     def __or__(self, other):
         if not isinstance(other, Iterable):
             return NotImplemented


More information about the Python-checkins mailing list