equal
deleted
inserted
replaced
2605 self._ascending = False |
2605 self._ascending = False |
2606 else: |
2606 else: |
2607 if self._ascending: |
2607 if self._ascending: |
2608 self.reverse() |
2608 self.reverse() |
2609 |
2609 |
2610 def __add__(self, other): |
|
2611 """When both collections are ascending or descending, preserve the order |
|
2612 """ |
|
2613 kwargs = {} |
|
2614 if self._ascending is not None: |
|
2615 if self.isascending() and other.isascending(): |
|
2616 kwargs['ascending'] = True |
|
2617 if self.isdescending() and other.isdescending(): |
|
2618 kwargs['ascending'] = False |
|
2619 return _addset(self, other, **kwargs) |
|
2620 |
|
2621 def _iterator(self): |
2610 def _iterator(self): |
2622 """Iterate over both collections without repeating elements |
2611 """Iterate over both collections without repeating elements |
2623 |
2612 |
2624 If the ascending attribute is not set, iterate over the first one and |
2613 If the ascending attribute is not set, iterate over the first one and |
2625 then over the second one checking for membership on the first one so we |
2614 then over the second one checking for membership on the first one so we |