Message111431
| Author |
daniel.urban |
| Recipients |
daniel.urban, eric.araujo, rhettinger, stutzbach, terry.reedy |
| Date |
2010年07月24日.08:03:58 |
| SpamBayes Score |
0.0005272628 |
| Marked as misclassified |
No |
| Message-id |
<1279958642.41.0.26316375838.issue9212@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> Unless there is a reason I have missed, I would iterate through the
> smaller set, which might even be empty or nearly so, rather than
> either in particular.
You're right, here is a new patch. Pseudocode:
def isdisjoint(self, other):
if self is other:
if len(self) == 0:
return True
else:
return False
else:
if len(other) > len(self):
self, other = other, self
for item in other:
if item in self:
return False
return True |
|