Skip to content

show UUID as Base.UUID(...) when not imported#52881

Merged
jishnub merged 2 commits intomasterfrom
stevengj-patch-9
Jan 13, 2024
Merged

show UUID as Base.UUID(...) when not imported#52881
jishnub merged 2 commits intomasterfrom
stevengj-patch-9

Conversation

@stevengj
Copy link
Copy Markdown
Member

@stevengj stevengj commented Jan 12, 2024

Fixes the problem identified in #52795 (comment) thanks to @IanButterworth — currently, a UUID displays as:

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

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.

@stevengj stevengj added the display and printing Aesthetics and correctness of printed representations of objects. label Jan 12, 2024
@jishnub jishnub merged commit 6dc0da4 into master Jan 13, 2024
@jishnub jishnub deleted the stevengj-patch-9 branch January 13, 2024 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

display and printing Aesthetics and correctness of printed representations of objects.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants