Show More
@@ -2283,7 +2283,7 b' class lazyset(object):' | |||||
2283 | return lazyset(self, lambda r: r not in x) |
|
2283 | return lazyset(self, lambda r: r not in x) | |
2284 |
|
2284 | |||
2285 | def __add__(self, x): |
|
2285 | def __add__(self, x): | |
2286 |
return |
|
2286 | return _addset(self, x) | |
2287 |
|
2287 | |||
2288 | def __nonzero__(self): |
|
2288 | def __nonzero__(self): | |
2289 | for r in self: |
|
2289 | for r in self: | |
@@ -2347,6 +2347,14 b' class orderedlazyset(lazyset):' | |||||
2347 | return orderedlazyset(self, lambda r: r not in x, |
|
2347 | return orderedlazyset(self, lambda r: r not in x, | |
2348 | ascending=self._ascending) |
|
2348 | ascending=self._ascending) | |
2349 |
|
2349 | |||
|
2350 | def __add__(self, x): | |||
|
2351 | kwargs = {} | |||
|
2352 | if self.isascending() and x.isascending(): | |||
|
2353 | kwargs['ascending'] = True | |||
|
2354 | if self.isdescending() and x.isdescending(): | |||
|
2355 | kwargs['ascending'] = False | |||
|
2356 | return _addset(self, x, **kwargs) | |||
|
2357 | ||||
2350 | def sort(self, reverse=False): |
|
2358 | def sort(self, reverse=False): | |
2351 | if reverse: |
|
2359 | if reverse: | |
2352 | if self._ascending: |
|
2360 | if self._ascending: | |
@@ -2694,7 +2702,12 b' class spanset(object):' | |||||
2694 | return orderedlazyset(self, lambda r: r not in x, ascending=False) |
|
2702 | return orderedlazyset(self, lambda r: r not in x, ascending=False) | |
2695 |
|
2703 | |||
2696 | def __add__(self, x): |
|
2704 | def __add__(self, x): | |
2697 | return lazyset(_addset(self, x)) |
|
2705 | kwargs = {} | |
|
2706 | if self.isascending() and x.isascending(): | |||
|
2707 | kwargs['ascending'] = True | |||
|
2708 | if self.isdescending() and x.isdescending(): | |||
|
2709 | kwargs['ascending'] = False | |||
|
2710 | return _addset(self, x, **kwargs) | |||
2698 |
|
2711 | |||
2699 | def __len__(self): |
|
2712 | def __len__(self): | |
2700 | if not self._hiddenrevs: |
|
2713 | if not self._hiddenrevs: |
General Comments 0
You need to be logged in to leave comments.
Login now