Beispiel #1
0
    def deepcopy(self, scope=None):
        _ = scope

        mother = self.get_mother().deepcopy()
        children = [x.deepcopy() for x in self.get_children()]

        copy = Rule(mother, children)

        Scope.deepcopy(self, copy)

        # I haven't thought through whether the next lines are necessary.
        # They don't hurt.
        copy.get_mother().set_scope(copy)
        for child in copy.get_children():
            child.set_scope(copy)

        return copy