Ticket #3564: sage-3564.patch

File sage-3564.patch, 1.6 kB (added by was, 5 months ago)
  • a/sage/calculus/calculus.py

    old new  
    289289 
    290290import sage.ext.fast_eval as fast_float 
    291291 
    292 #needed for converting from SymPy to SAGE 
    293 import sympy 
    294  
    295292# TODO: What the heck does this is_simplified thing do? 
    296293is_simplified = False 
    297294 
     
    465462        elif isinstance(x, MaximaElement): 
    466463            return symbolic_expression_from_maxima_element(x) 
    467464        # if "x" is a SymPy object, convert it to a SAGE object 
    468         elif isinstance(x, sympy.Basic): 
    469             return self(x._sage_()) 
    470465        elif is_Polynomial(x) or is_MPolynomial(x): 
    471466            if x.base_ring() != self:  # would want coercion to go the other way 
    472467                return SymbolicPolynomial(x) 
     
    494489            return SymbolicConstant(x) 
    495490        elif isinstance(x, complex): 
    496491            return evaled_symbolic_expression_from_maxima_string('%s+%%i*%s'%(x.real,x.imag)) 
     492         
     493        from sympy.core.basic import Basic 
     494        if isinstance(x, Basic): 
     495            return self(x._sage_()) 
    497496        else: 
    498497            raise TypeError, "cannot coerce type '%s' into a SymbolicExpression."%type(x) 
    499498