Show More
@@ -2397,6 +2397,22 b' class _addset(object):' | |||||
2397 | return orderedlazyset(self, condition, ascending=self._ascending) |
|
2397 | return orderedlazyset(self, condition, ascending=self._ascending) | |
2398 | return lazyset(self, condition) |
|
2398 | return lazyset(self, condition) | |
2399 |
|
2399 | |||
|
2400 | def ascending(self): | |||
|
2401 | if self._ascending is None: | |||
|
2402 | self.sort() | |||
|
2403 | self._ascending = True | |||
|
2404 | else: | |||
|
2405 | if not self._ascending: | |||
|
2406 | self.reverse() | |||
|
2407 | ||||
|
2408 | def descending(self): | |||
|
2409 | if self._ascending is None: | |||
|
2410 | self.sort(reverse=True) | |||
|
2411 | self._ascending = False | |||
|
2412 | else: | |||
|
2413 | if self._ascending: | |||
|
2414 | self.reverse() | |||
|
2415 | ||||
2400 | def _iterator(self): |
|
2416 | def _iterator(self): | |
2401 | """Iterate over both collections without repeating elements |
|
2417 | """Iterate over both collections without repeating elements | |
2402 |
|
2418 |
General Comments 0
You need to be logged in to leave comments.
Login now