##// END OF EJS Templates
generatorset: make it possible to use gen as fastasc or fastdesc...
Pierre-Yves David -
r22755:f9a825b5 default
parent child Browse files
Show More
@@ -2622,7 +2622,7 class _generatorset(abstractsmartset):
2622 This class does not duck-type baseset and it's only supposed to be used
2622 This class does not duck-type baseset and it's only supposed to be used
2623 internally
2623 internally
2624 """
2624 """
2625 def __init__(self, gen):
2625 def __init__(self, gen, iterasc=None):
2626 """
2626 """
2627 gen: a generator producing the values for the generatorset.
2627 gen: a generator producing the values for the generatorset.
2628 """
2628 """
@@ -2630,6 +2630,11 class _generatorset(abstractsmartset):
2630 self._cache = {}
2630 self._cache = {}
2631 self._genlist = baseset([])
2631 self._genlist = baseset([])
2632 self._finished = False
2632 self._finished = False
2633 if iterasc is not None:
2634 if iterasc:
2635 self.fastasc = self.__iter__
2636 else:
2637 self.fastdesc = self.__iter__
2633
2638
2634 def __nonzero__(self):
2639 def __nonzero__(self):
2635 for r in self:
2640 for r in self:
General Comments 0
You need to be logged in to leave comments. Login now