The problem I am having is that when I have a fraction as an exponent in my sympy function, srepr evaluates that fraction and returns a float. I would like for the fraction to remain in the expression tree output instead of being evaluated and returned as a float.
Example: Function = (x**3 - 7)^(3/7)
srepr(Function)
Output: "Pow(Add(Pow(Symbol('x'), Integer(3)), Integer(-7)), Float('0.42857142857142855', precision=53))"
Doing this process backwards, the function above can be represented by
Pow(Add(Pow(x,3),-7),Rational(3, 7))
where the fraction (3/7) is represented by Rational. However as seen above, the output of srepr of this same function will not contain "Rational" to represent the fraction. O.O
The same thing happens when I evaluate an expression by a SymPy function such as "Integral", the fraction gets converted to a float instead of remaining as a fraction. The reason why I need the fraction is because I am doing manual integration so manipulation of the fraction is important for seeing how the process is carried out.
Any help will be greatly appreciated