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

Roundtrip printing #466

Closed
YingboMa opened this issue Jul 16, 2021 · 2 comments
Closed

Roundtrip printing #466

YingboMa opened this issue Jul 16, 2021 · 2 comments

Comments

@YingboMa
Copy link

Currently, show displays units that are cannot be copy-pasted into Julia REPL. This makes serializing expressions impossible if the expression contains unitful objects.

julia> using Unitful

julia> unit = u"m/s";

julia> show(unit)
m s⁻¹
julia> :(x = $unit)
:(x = m s⁻¹)

In Julia, by convention, pretty print should only be done on MIME methods, and default show should do roundtrip

@giordano
Copy link
Collaborator

In Julia, by convention, pretty print should only be done on MIME methods, and default show should do roundtrip

Really? I thought that was repr (not that the result here is different)

@giordano
Copy link
Collaborator

Duplicate of #391

@giordano giordano marked this as a duplicate of #391 Jul 16, 2021
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

2 participants