commit | abf3fcf39fb3bff4d347296a083a4c62d515dacd | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Wed Jan 30 00:01:07 2008 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Wed Jan 30 00:01:07 2008 +0000 |
tree | a1e753b1c89a53417a2ac71c8dc10ceb9952a5c3 | |
parent | 867558afd69675be8263a19c3d23b92812a0a62a [diff] [blame] |
Add isdisjoint() to the Set/MutableSet ABCs.
diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py index ac967b2..3a84b96 100644 --- a/Lib/_abcoll.py +++ b/Lib/_abcoll.py
@@ -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