equal
deleted
inserted
replaced
2417 filterfunc = other.__contains__ |
2417 filterfunc = other.__contains__ |
2418 if self._ascending is not None: |
2418 if self._ascending is not None: |
2419 return orderedlazyset(self, filterfunc, ascending=self._ascending) |
2419 return orderedlazyset(self, filterfunc, ascending=self._ascending) |
2420 return lazyset(self, filterfunc) |
2420 return lazyset(self, filterfunc) |
2421 |
2421 |
|
2422 def __sub__(self, other): |
|
2423 filterfunc = lambda r: r not in other |
|
2424 if self._ascending is not None: |
|
2425 return orderedlazyset(self, filterfunc, ascending=self._ascending) |
|
2426 return lazyset(self, filterfunc) |
|
2427 |
2422 def _iterator(self): |
2428 def _iterator(self): |
2423 """Iterate over both collections without repeating elements |
2429 """Iterate over both collections without repeating elements |
2424 |
2430 |
2425 If the ascending attribute is not set, iterate over the first one and |
2431 If the ascending attribute is not set, iterate over the first one and |
2426 then over the second one checking for membership on the first one so we |
2432 then over the second one checking for membership on the first one so we |