def __init__(self, rule_list):
    self.rules = dict()
    for (parents, fstdeg, snddeg) in rule_list:
        for parent in parents:
            self.rules[parent] = {'fst': fstdeg, 'snd': snddeg}
def __init__(self, rule_list):
    self.rules = dict()
    for (parents, fstdeg, snddeg) in rule_list:
        for parent in parents:
            self.rules[parent] = {'fst': fstdeg, 'snd': snddeg}