def __init__(self, start, stop=None): GeneratorPattern.__init__(self) if hasattr(start, "__iter__"): self.data = Pattern(start) self.func = lambda index: random.choice(self.data) else: self.low = start if stop is not None else 0 self.high = stop if stop is not None else start
def __init__(self, start, stop=None): GeneratorPattern.__init__(self) if hasattr(start, "__iter__"): self.data = start self.func = lambda index: random.choice(Pattern(self.data)) else: self.low = start if stop is not None else 0 self.high = stop if stop is not None else start
def __init__(self, lo=0, hi=1): GeneratorPattern.__init__(self) self.low = float(lo) self.high = float(hi) self.mid = (lo + hi) / 2.0