On Wed, Feb 4, 2015 at 6:23 AM, Neal Becker <ndbeck...@gmail.com> wrote: > class rpt: > def __init__ (self, value, rpt): > self.value = value; self.rpt = rpt > def __call__ (self): > for i in range (self.rpt): > yield self.value
Note that this class is just reimplementing itertools.repeat. >>> list(itertools.repeat('hello', 5)) ['hello', 'hello', 'hello', 'hello', 'hello'] -- https://mail.python.org/mailman/listinfo/python-list