Beispiel #1
0
    def switch_context(self, context):

        self.previous_context.append(self.context)
        self.context = context

        global_assumptions.clear()
        global_assumptions.update(self.context.assumptions)
Beispiel #2
0
    def restore(self):

        if self.previous is None:
            return

        self.assumptions.update(global_assumptions)
        global_assumptions.clear()
        global_assumptions.update(self.previous.assumptions)
Beispiel #3
0
    def switch(self):

        global context

        self.previous = context
        context = self
        global_assumptions.clear()
        global_assumptions.update(self.assumptions)
Beispiel #4
0
    def restore_context(self):

        self.context.assumptions.update(global_assumptions)

        self.context = self.previous_context.pop()

        global_assumptions.clear()
        global_assumptions.update(self.context.assumptions)
Beispiel #5
0
    def restore(self):

        if self.previous is None:
            return

        self.assumptions.update(global_assumptions)
        global_assumptions.clear()
        global_assumptions.update(self.previous.assumptions)
Beispiel #6
0
    def switch(self):

        global context

        self.previous = context
        context = self
        global_assumptions.clear()
        global_assumptions.update(self.assumptions)