From 351a9002be3bc8cf8a612ec6be494ff74d4b7fa4 Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand Date: Wed, 9 Mar 2016 09:27:27 +0300 Subject: [PATCH] steal_history in explicable --- pymath/calculus/explicable.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pymath/calculus/explicable.py b/pymath/calculus/explicable.py index 9ac3dad..2e2a47b 100644 --- a/pymath/calculus/explicable.py +++ b/pymath/calculus/explicable.py @@ -128,6 +128,18 @@ class Explicable(Renderable): """ self.steps = steps + self.steps + def steal_history(self, arg1): + """ Steal the history of arg1 for itself + + :param arg1: a potential Explicable + + """ + try: + self.this_append_before(list(arg1.explain())) + except AttributeError: + pass + + @staticmethod def merge_history(explicables): r""" Take a list of Explicable objects, explain where they are from and merge their history