JuliaLang/julia

Stable API to strip type parameters from type

Open

#35,543 opened on 2020年4月21日

GitHub で見る
 (14 comments) (17 reactions) (0 assignees)Julia (5,773 forks)batch import
featurehelp wanted

Repository metrics

Stars
 (48,709 stars)
PR merge metrics
 (平均マージ 20d 6h) (30d で 157 merged PRs)

説明

Is there a function to strip the type parameters from a type? For example:

strip_type_parameters(Array{Int,3}) # should return Array

There is one way to do this but it is not documented (pointed out by @jakobnissen):

strip_type_parameters(T) = Base.typename(T).wrapper

Therefore in principle it can change in future versions.

Why not have a stable API for this?

コントリビューターガイド