Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Displaying Syms giving escaped strings instead of pretty printing #468

Open
akriegman opened this issue May 30, 2022 · 1 comment
Open

Comments

@akriegman
Copy link

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.

@akriegman
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant