Show More
@@ -2204,6 +2204,12 b' class baseset(list):' | |||||
2204 | l = [r for r in x if r not in s] |
|
2204 | l = [r for r in x if r not in s] | |
2205 | return baseset(list(self) + l) |
|
2205 | return baseset(list(self) + l) | |
2206 |
|
2206 | |||
|
2207 | def isascending(self): | |||
|
2208 | return False | |||
|
2209 | ||||
|
2210 | def isdescending(self): | |||
|
2211 | return False | |||
|
2212 | ||||
2207 | def filter(self, l): |
|
2213 | def filter(self, l): | |
2208 | return lazyset(self, l) |
|
2214 | return lazyset(self, l) | |
2209 |
|
2215 | |||
@@ -2270,6 +2276,12 b' class lazyset(object):' | |||||
2270 | def set(self): |
|
2276 | def set(self): | |
2271 | return set([r for r in self]) |
|
2277 | return set([r for r in self]) | |
2272 |
|
2278 | |||
|
2279 | def isascending(self): | |||
|
2280 | return False | |||
|
2281 | ||||
|
2282 | def isdescending(self): | |||
|
2283 | return False | |||
|
2284 | ||||
2273 | def filter(self, l): |
|
2285 | def filter(self, l): | |
2274 | return lazyset(self, l) |
|
2286 | return lazyset(self, l) | |
2275 |
|
2287 | |||
@@ -2309,6 +2321,12 b' class orderedlazyset(lazyset):' | |||||
2309 | self._subset.sort(reverse=reverse) |
|
2321 | self._subset.sort(reverse=reverse) | |
2310 | self._ascending = not reverse |
|
2322 | self._ascending = not reverse | |
2311 |
|
2323 | |||
|
2324 | def isascending(self): | |||
|
2325 | return self._ascending | |||
|
2326 | ||||
|
2327 | def isdescending(self): | |||
|
2328 | return not self._ascending | |||
|
2329 | ||||
2312 | def reverse(self): |
|
2330 | def reverse(self): | |
2313 | self._subset.reverse() |
|
2331 | self._subset.reverse() | |
2314 | self._ascending = not self._ascending |
|
2332 | self._ascending = not self._ascending | |
@@ -2621,6 +2639,12 b' class spanset(object):' | |||||
2621 | def set(self): |
|
2639 | def set(self): | |
2622 | return self |
|
2640 | return self | |
2623 |
|
2641 | |||
|
2642 | def isascending(self): | |||
|
2643 | return self._start < self._end | |||
|
2644 | ||||
|
2645 | def isdescending(self): | |||
|
2646 | return self._start > self._end | |||
|
2647 | ||||
2624 | def filter(self, l): |
|
2648 | def filter(self, l): | |
2625 | if self._start <= self._end: |
|
2649 | if self._start <= self._end: | |
2626 | return orderedlazyset(self, l) |
|
2650 | return orderedlazyset(self, l) |
General Comments 0
You need to be logged in to leave comments.
Login now