SymPy.jl
SymPy.jl copied to clipboard
Displaying Syms giving escaped strings instead of pretty printing
When I try to display symbols in the repl, they get displayed as PyObjects with an escaped string representation, instead of the usual pretty printing. MWE:
julia> @vars x
(x,)
julia> x^2
PyObject ' 2\nx '
I have no idea what I may have done to trigger this. It worked correctly the last time I used SymPy.jl, and it seems like it's supposed to just work out of the box according to the docs. I'm not sure what's supposed to happen normally, but it's not happening.
I was able to get around this by overriding the show
implementation given in SymPy.jl
:
Base.show(io::IO, ::MIME"text/plain", s::SymPy.SymbolicObject) = print(io, pystr(sympy.pretty(s)))
Still, not sure why this happened in the first place.