-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix PkgId repr #52795
Fix PkgId repr #52795
Conversation
In Julia 1.10, interpolation is calling the expected julia> pkgid = Base.PkgId(Base.UUID("295af30f-e4ad-537b-8983-00126c2a3abe"), "Revise")
Revise [295af30f-e4ad-537b-8983-00126c2a3abe]
julia> "$pkgid"
"Revise [295af30f-e4ad-537b-8983-00126c2a3abe]" |
Indeed. This PR breaks that. I'm not sure how to achieve both a usable repr and the nice interpolation version |
The missing qualification of julia> Base.UUID("295af30f-e4ad-537b-8983-00126c2a3abe")
UUID("295af30f-e4ad-537b-8983-00126c2a3abe") which should probably be defined as: show(io::IO, u::UUID) = print(io, UUID, "(\"", u, "\")") so that it uses the |
Interpolation calls Normally the 3-arg |
What I think would make sense and be helpful would be
|
That's not the way string interpolation works with any other type of object AFAIK… I don't think it would be a good idea to make If you want the 3-arg |
Fixes the problem identified in #52795 (comment) thanks to @IanButterworth — currently, a `UUID` displays as: ```jl julia> Base.UUID("30b93cbd-6b28-44ea-8d3f-42a2b647d023") UUID("30b93cbd-6b28-44ea-8d3f-42a2b647d023") ``` even if the `UUID` symbol has not been imported. It should display as a qualified name `Base.UUID` unless `UUID` is imported (e.g. by doing `using UUIDs`). That is, after this PR you will get ```jl julia> Base.UUID("30b93cbd-6b28-44ea-8d3f-42a2b647d023") Base.UUID("30b93cbd-6b28-44ea-8d3f-42a2b647d023") ``` This is a tiny patch that just uses the standard type-printing machinery to decide how to display the `UUID` type name.
0cf80f5
to
0da3209
Compare
0da3209
to
2beec8e
Compare
Only ":windows: build i686-w64-mingw32" failed in 4s. |
I was just reading through the loading.jl file in detail, and it seems like this failed to update most of the places that I think would be expected, such as |
Just fix them up I guess. This is still an improvement to make the |
Fixes #52793
Although
UUID
should beBase.UUID
otherwise this is only usable in Base.Also interpolation seems to be using the wrong show method?