Show More
@@ -2425,6 +2425,17 b' class _addset(object):' | |||||
2425 | return orderedlazyset(self, filterfunc, ascending=self._ascending) |
|
2425 | return orderedlazyset(self, filterfunc, ascending=self._ascending) | |
2426 | return lazyset(self, filterfunc) |
|
2426 | return lazyset(self, filterfunc) | |
2427 |
|
2427 | |||
|
2428 | def __add__(self, other): | |||
|
2429 | """When both collections are ascending or descending, preserve the order | |||
|
2430 | """ | |||
|
2431 | kwargs = {} | |||
|
2432 | if self._ascending is not None: | |||
|
2433 | if self.isascending() and other.isascending(): | |||
|
2434 | kwargs['ascending'] = True | |||
|
2435 | if self.isdescending() and other.isdescending(): | |||
|
2436 | kwargs['ascending'] = False | |||
|
2437 | return _addset(self, other, **kwargs) | |||
|
2438 | ||||
2428 | def _iterator(self): |
|
2439 | def _iterator(self): | |
2429 | """Iterate over both collections without repeating elements |
|
2440 | """Iterate over both collections without repeating elements | |
2430 |
|
2441 |
General Comments 0
You need to be logged in to leave comments.
Login now