equal
deleted
inserted
replaced
2278 |
2278 |
2279 def __add__(self, other): |
2279 def __add__(self, other): |
2280 """Returns a new object with the union of the two collections. |
2280 """Returns a new object with the union of the two collections. |
2281 |
2281 |
2282 This is part of the mandatory API for smartset.""" |
2282 This is part of the mandatory API for smartset.""" |
2283 raise NotImplementedError() |
2283 kwargs = {} |
|
2284 if self.isascending() and other.isascending(): |
|
2285 kwargs['ascending'] = True |
|
2286 if self.isdescending() and other.isdescending(): |
|
2287 kwargs['ascending'] = False |
|
2288 return _addset(self, other, **kwargs) |
2284 |
2289 |
2285 def __sub__(self, other): |
2290 def __sub__(self, other): |
2286 """Returns a new object with the substraction of the two collections. |
2291 """Returns a new object with the substraction of the two collections. |
2287 |
2292 |
2288 This is part of the mandatory API for smartset.""" |
2293 This is part of the mandatory API for smartset.""" |