From 8ff1fe8c5e9a3c1a3eaff48c4ef6b38333d5a82d Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Tue, 29 Dec 2015 11:51:25 -0600 Subject: [PATCH 1/2] Adding an identical function class attribute. --- src/sage/interfaces/gap.py | 3 ++- src/sage/interfaces/gap3.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py index efc08eaaca2..0f1f942c3fe 100644 --- a/src/sage/interfaces/gap.py +++ b/src/sage/interfaces/gap.py @@ -308,6 +308,7 @@ class Gap_generic(Expect): code """ + _identical_function = "IsIdenticalObj" def _synchronize(self, timeout=0.5, cmd='%s;'): """ @@ -918,7 +919,7 @@ def function_call(self, function, args=None, kwds=None): else: self.eval(marker) res = self.eval(cmd) - if self.eval('IsIdenticalObj(last,__SAGE_LAST__)') != 'true': + if self.eval(self._identical_function + '(last,__SAGE_LAST__)') != 'true': return self.new('last2;') else: if res.strip(): diff --git a/src/sage/interfaces/gap3.py b/src/sage/interfaces/gap3.py index e183f1a9e7d..bc2504f6717 100644 --- a/src/sage/interfaces/gap3.py +++ b/src/sage/interfaces/gap3.py @@ -301,6 +301,8 @@ def __init__(self, command=gap3_cmd): sage: gap3.is_running() #optional - gap3 True """ + _identical_function = "IsIdentical" + self.__gap3_command_string = command # Explanation of additional command-line options passed to gap3: # From efdffd54d63ab56936a143481cd5b47086b1200a Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Tue, 29 Dec 2015 18:14:50 -0600 Subject: [PATCH 2/2] Putting the class attribute in the correct place. --- src/sage/interfaces/gap3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/interfaces/gap3.py b/src/sage/interfaces/gap3.py index bc2504f6717..309b01fd44a 100644 --- a/src/sage/interfaces/gap3.py +++ b/src/sage/interfaces/gap3.py @@ -282,6 +282,8 @@ class Gap3(Gap_generic): - Franco Saliola (Feb 2010) """ + _identical_function = "IsIdentical" + def __init__(self, command=gap3_cmd): r""" Initialize the GAP3 interface and start a session. @@ -301,8 +303,6 @@ def __init__(self, command=gap3_cmd): sage: gap3.is_running() #optional - gap3 True """ - _identical_function = "IsIdentical" - self.__gap3_command_string = command # Explanation of additional command-line options passed to gap3: #