##// END OF EJS Templates
baseset: implement `first` and `last` methods
Pierre-Yves David -
r22812:fcd12b31 default
parent child Browse files
Show More
@@ -2387,6 +2387,16 b' class baseset(list, abstractsmartset):'
2387 This is part of the mandatory API for smartset."""
2387 This is part of the mandatory API for smartset."""
2388 return False
2388 return False
2389
2389
2390 def first(self):
2391 if self:
2392 return self[0]
2393 return None
2394
2395 def last(self):
2396 if self:
2397 return self[-1]
2398 return None
2399
2390 class filteredset(abstractsmartset):
2400 class filteredset(abstractsmartset):
2391 """Duck type for baseset class which iterates lazily over the revisions in
2401 """Duck type for baseset class which iterates lazily over the revisions in
2392 the subset and contains a function which tests for membership in the
2402 the subset and contains a function which tests for membership in the
General Comments 0
You need to be logged in to leave comments. Login now