Hi there,
I have a problem when doing some inheritance from class
SymbolicArithmetic in sage from version 3.4 and up. There is no
problem with 3.3. Here is a sample code :
in file classtest.sage put :
____
class test(SymbolicArithmetic):
def __init__(self,eq):
SymbolicArithmetic.__init__(self,[eq,0],operator.sub)
____
then "load classtest.sage" works fine in both in sage 3.3 and sage
3.4.2 :
sage: load classtest.sage
sage: a=test(x)
sage: a
x
But if you add the following file "dummy.sage" :
____
load classtest.sage
____
then things work fine in sage.3.3 and give an AttributeError in 3.4.2.
Is this a bug or am I doing something wrong ?
Could I get around it by not substracting this 0 which is possibly the
source of the problem ?
Thank you all in adavance
Nicolas
sage.3.3:
sage: load dummy.sage
sage: a=test(x)
sage: a
x
sage.3.4.2:
sage: load dummy.sage
sage: a=test(x)
sage: a
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
/home/fresseng/.sage/temp/nix.sciences.univ_metz.fr/5786/
_home_fresseng_Documents_Recherche_science_Escapade_dempf_Dempf_svn_dempf_classtest_dummy_sage_17.py
in <module>()
/usr/local/src/sage-3.4.2/local/lib/python2.5/site-packages/IPython/
Prompts.pyc in __call__(self, arg)
549
550 # and now call a possibly user-defined print
mechanism
--> 551 manipulated_val = self.display(arg)
552
553 # user display hooks can change the variable to be
stored in
/usr/local/src/sage-3.4.2/local/lib/python2.5/site-packages/IPython/
Prompts.pyc in _display(self, arg)
575 return IPython.generics.result_display(arg)
576 except TryNext:
--> 577 return self.shell.hooks.result_display(arg)
578
579 # Assign the default display method:
/usr/local/src/sage-3.4.2/local/lib/python2.5/site-packages/IPython/
hooks.pyc in __call__(self, *args, **kw)
139 #print "prio",prio,"cmd",cmd #dbg
140 try:
--> 141 ret = cmd(*args, **kw)
142 return ret
143 except ipapi.TryNext, exc:
/usr/local/src/sage-3.4.2/local/lib/python2.5/site-packages/IPython/
hooks.pyc in result_display(self, arg)
169
170 if self.rc.pprint:
--> 171 out = pformat(arg)
172 if '\n' in out:
173 # So that multi-line strings line up with the left
column of
/usr/local/src/sage-3.4.2/local/lib/python/pprint.pyc in pformat(self,
object)
109 def pformat(self, object):
110 sio = _StringIO()
--> 111 self._format(object, sio, 0, 0, {}, 0)
112 return sio.getvalue()
113
/usr/local/src/sage-3.4.2/local/lib/python/pprint.pyc in _format(self,
object, stream, indent, allowance, context, level)
127 self._readable = False
128 return
--> 129 rep = self._repr(object, context, level - 1)
130 typ = _type(object)
131 sepLines = _len(rep) > (self._width - 1 - indent -
allowance)
/usr/local/src/sage-3.4.2/local/lib/python/pprint.pyc in _repr(self,
object, context, level)
193 def _repr(self, object, context, level):
194 repr, readable, recursive = self.format(object,
context.copy(),
--> 195 self._depth,
level)
196 if not readable:
197 self._readable = False
/usr/local/src/sage-3.4.2/local/lib/python/pprint.pyc in format(self,
object, context, maxlevels, level)
205 and whether the object represents a recursive
construct.
206 """
--> 207 return _safe_repr(object, context, maxlevels, level)
208
209
/usr/local/src/sage-3.4.2/local/lib/python/pprint.pyc in _safe_repr
(object, context, maxlevels, level)
290 return format % _commajoin(components), readable,
recursive
291
--> 292 rep = repr(object)
293 return rep, (rep and not rep.startswith('<')), False
294
/usr/local/src/sage-3.4.2/local/lib/python2.5/site-packages/sage/
structure/sage_object.so in
sage.structure.sage_object.SageObject.__repr__ (sage/structure/
sage_object.c:1317)()
/usr/local/src/sage-3.4.2/local/lib/python2.5/site-packages/sage/
calculus/calculus.pyc in _repr_(self, simplify)
5940 return self._simp._repr_(simplify=False)
5941 else:
-> 5942 return self.simplify()._repr_(simplify=False)
5943
5944 ops = self._operands
/usr/local/src/sage-3.4.2/local/lib/python2.5/site-packages/sage/
calculus/calculus.pyc in simplify(self)
4000 return self._simp
4001 except AttributeError:
-> 4002 S = evaled_symbolic_expression_from_maxima_string
(self._maxima_init_())
4003 S._simp = None
4004 self._simp = S
/usr/local/src/sage-3.4.2/local/lib/python2.5/site-packages/sage/
calculus/calculus.pyc in _maxima_init_(self)
6114 return '(%s) %s (%s)' % (ops[0]._maxima_init_(),
6115 infixops[self._operator],
-> 6116 ops[1]._maxima_init_())
6117
6118 def _sympy_(self):
AttributeError: 'int' object has no attribute '_maxima_init_'
sage:
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---