I am trying to get the base type name of an instance of a parametric type.
In julia up to 1.5 I would use typeof(obj).name
which would do what I want. But something changed in current nightlies.
For example, in 1.6:
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.6.0-DEV.1647 (2020-12-03)
_/ |\__'_|_|_|\__'_| | Commit 49b8e61a80* (7 days old master)
|__/ |
julia> using GLM
julia> y=rand(100); X=rand(100,4);
julia> m=lm(X,y)
LinearModel{GLM.LmResp{Vector{Float64}}, GLM.DensePredChol{Float64, LinearAlgebra.Cholesky{Float64, Matrix{Float64}}}}:
Coefficients:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Coef. Std. Error t Pr(>|t|) Lower 95% Upper 95%
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
x1 0.0448507 0.0959875 0.47 0.6414 -0.145683 0.235384
x2 0.415308 0.0970493 4.28 <1e-04 0.222667 0.607949
x3 0.243972 0.091193 2.68 0.0088 0.062955 0.424988
x4 0.157658 0.0943933 1.67 0.0981 -0.0297113 0.345027
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
julia> typeof(m).name
typename(LinearModel)
But the same code in julia 1.5 gives
julia> typeof(m).name
LinearModel
Is there a generic way to get βLinearModelβ that works in both julia versions?