equal
deleted
inserted
replaced
2416 """ |
2416 """ |
2417 self._subset = subset |
2417 self._subset = subset |
2418 self._condition = condition |
2418 self._condition = condition |
2419 self._cache = {} |
2419 self._cache = {} |
2420 |
2420 |
2421 def min(self): |
|
2422 return min(self) |
|
2423 |
|
2424 def max(self): |
|
2425 return max(self) |
|
2426 |
|
2427 def __contains__(self, x): |
2421 def __contains__(self, x): |
2428 c = self._cache |
2422 c = self._cache |
2429 if x not in c: |
2423 if x not in c: |
2430 v = c[x] = x in self._subset and self._condition(x) |
2424 v = c[x] = x in self._subset and self._condition(x) |
2431 return v |
2425 return v |