Message111431
> 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 |
|
Date |
User |
Action |
Args |
2010-07-24 08:04:02 | daniel.urban | set | recipients:
+ daniel.urban, rhettinger, terry.reedy, stutzbach, eric.araujo |
2010-07-24 08:04:02 | daniel.urban | set | messageid: <1279958642.41.0.26316375838.issue9212@psf.upfronthosting.co.za> |
2010-07-24 08:04:00 | daniel.urban | link | issue9212 messages |
2010-07-24 08:04:00 | daniel.urban | create | |
|