In [1]:
import tohu
from tohu.generators import BaseGenerator
from tohu.custom_generator import logger, CustomGeneratorMeta
from tohu.debugging import DummyGenerator
tohu.debugging.logger.setLevel('DEBUG')
In [2]:
class QuuxGenerator(BaseGenerator, metaclass=CustomGeneratorMeta):
z = 42
a = DummyGenerator('DummyA')
def __init__(self):
logger.debug("[QQQ] Start QuuxGenerator.__init__()")
self.b = DummyGenerator('DummyB')
self.foo = 23
logger.debug("[QQQ] End QuuxGenerator.__init__()")
In [3]:
g = QuuxGenerator()
In [4]:
g.reset(seed=None)
Out[4]:
In [5]:
g.reset(seed=12345)
Out[5]:
In [6]:
items = g.generate(10, seed=12345)
In [7]:
list(items)
Out[7]:
In [ ]: