JuliaLang/julia

Stable API to strip type parameters from type

Open

#35,543 建立於 2020年4月21日

在 GitHub 查看
 (14 留言) (17 反應) (0 負責人)Julia (5,773 fork)batch import
featurehelp wanted

倉庫指標

Star
 (48,709 star)
PR 合併指標
 (平均合併 20天 6小時) (30 天內合併 157 個 PR)

描述

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?

貢獻者指南