I'm trying to turn a type into its fully qualified name, as a string. I was hoping this would work "$(t.name.module).$(t.name.name)"
, but while for say t=IO
or t=DataFrame
it works, in other case such as t=Dict
it doesn't.
Is there a good general solution for this?
"$(parentmodule(t)).$(nameof(t))"
perhaps? Seems to at least cover Dict
as well.
otherwise, Base.unwrap_unionall
first
That seems to work well, thanks! Are there any caveats I should be aware of with parentmodule
/ nameof
?
The documentation seems to indicate they unwrap unionall for us.
yes
those two are public API (I think) and should be used over manually accessing the type's internals
Looks like I'm sorted then.
Timothy has marked this topic as resolved.
Last updated: Nov 22 2024 at 04:41 UTC