Show More
@@ -2159,5 +2159,27 b' class spanset(object):' | |||
|
2159 | 2159 | l = baseset(self) |
|
2160 | 2160 | return l + baseset(x) |
|
2161 | 2161 | |
|
2162 | def __len__(self): | |
|
2163 | return abs(self._end - self._start) | |
|
2164 | ||
|
2165 | def __getitem__(self, x): | |
|
2166 | # Basic implementation to be changed in future patches. | |
|
2167 | l = baseset([r for r in self]) | |
|
2168 | return l[x] | |
|
2169 | ||
|
2170 | def sort(self, reverse=False): | |
|
2171 | # Basic implementation to be changed in future patches. | |
|
2172 | if reverse: | |
|
2173 | self.reverse() | |
|
2174 | ||
|
2175 | def reverse(self): | |
|
2176 | if self._start <= self._end: | |
|
2177 | self._start, self._end = self._end - 1, self._start - 1 | |
|
2178 | else: | |
|
2179 | self._start, self._end = self._end + 1, self._start + 1 | |
|
2180 | ||
|
2181 | def set(self): | |
|
2182 | return self | |
|
2183 | ||
|
2162 | 2184 | # tell hggettext to extract docstrings from these functions: |
|
2163 | 2185 | i18nfunctions = symbols.values() |
General Comments 0
You need to be logged in to leave comments.
Login now