Show More
@@ -2248,11 +2248,19 b' class abstractsmartset(object):' | |||||
2248 |
|
2248 | |||
2249 | def min(self): |
|
2249 | def min(self): | |
2250 | """return the minimum element in the set""" |
|
2250 | """return the minimum element in the set""" | |
2251 | raise NotImplementedError() |
|
2251 | if self.fastasc is not None: | |
|
2252 | for r in self.fastasc(): | |||
|
2253 | return r | |||
|
2254 | raise ValueError('arg is an empty sequence') | |||
|
2255 | return min(self) | |||
2252 |
|
2256 | |||
2253 | def max(self): |
|
2257 | def max(self): | |
2254 | """return the maximum element in the set""" |
|
2258 | """return the maximum element in the set""" | |
2255 | raise NotImplementedError() |
|
2259 | if self.fastdesc is not None: | |
|
2260 | for r in self.fastdesc(): | |||
|
2261 | return r | |||
|
2262 | raise ValueError('arg is an empty sequence') | |||
|
2263 | return max(self) | |||
2256 |
|
2264 | |||
2257 | def reverse(self): |
|
2265 | def reverse(self): | |
2258 | """reverse the expected iteration order""" |
|
2266 | """reverse the expected iteration order""" |
General Comments 0
You need to be logged in to leave comments.
Login now