Show More
@@ -2277,6 +2277,15 b' class orderedlazyset(lazyset):' | |||||
2277 | return orderedlazyset(self, lambda r: r not in x, |
|
2277 | return orderedlazyset(self, lambda r: r not in x, | |
2278 | ascending=self._ascending) |
|
2278 | ascending=self._ascending) | |
2279 |
|
2279 | |||
|
2280 | def sort(self, reverse=False): | |||
|
2281 | if reverse: | |||
|
2282 | if self._ascending: | |||
|
2283 | self._subset.sort(reverse=reverse) | |||
|
2284 | else: | |||
|
2285 | if not self._ascending: | |||
|
2286 | self._subset.sort(reverse=reverse) | |||
|
2287 | self._ascending = not reverse | |||
|
2288 | ||||
2280 | def reverse(self): |
|
2289 | def reverse(self): | |
2281 | self._subset.reverse() |
|
2290 | self._subset.reverse() | |
2282 | self._ascending = not self._ascending |
|
2291 | self._ascending = not self._ascending |
General Comments 0
You need to be logged in to leave comments.
Login now