Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find parent and child type of a type?

Tags:

types

julia

julia> Integer <: Real
true

If we don't know the answer (Real) how to find the supertype of Integer?

Also, how to find all the subtypes of Integer?

like image 966
miha priimek Avatar asked Jul 24 '20 21:07

miha priimek


1 Answers

julia> supertype(Integer)
Real

julia> subtypes(Integer)
3-element Array{Any,1}:
 Bool
 Signed
 Unsigned

see also https://github.com/JuliaLang/julia/issues/24741

like image 186
miha priimek Avatar answered Sep 29 '22 04:09

miha priimek