Introspection

Term.Introspection.inspectMethod
inspect(T::DataType; documentation::Bool=false, constructors::Bool=true, methods::Bool=true, supertypes::Bool=true)

Inspect a DataType to show info such as docstring, constructors and methods. Flags can be used to choose the level of detail in the information presented:

  • documentation: show docstring with termshow
  • constructors: show T constructors
  • methods: show methods using T in their signature
  • supertypes: show methods using T's supertypes in their signature
source
Term.Introspection.typestreeMethod
typestree(T)
typestree(io::IO, T)

Print the type hierarchy for T in a pretty format. This is done using colors, indentation and unicode for maximal readability. The output included all supertypes, and one level of subtypes.

This function is not exported, so to use it you need to use the Term.typestree syntax, or import it manually by import Term: typestree

Example

Below is an example showing the type tree for Integer. Note that the colors of the output are not included in this docstring.

julia> Term.typestree(Integer)
╭────────────── Types hierarchy ───╮
│                                  │
│  Number                          │
│ ━━━━━━━━                         │
│    │                             │
│    ├── Complex                   │
│    └── Real                      │
│        ├── Rational              │
│        ├── AbstractIrrational    │
│        ├── Integer               │
│        │   ├── Signed            │
│        │   ├── Unsigned          │
│        │   └── Bool              │
│        └── AbstractFloat         │
│                                  │
╰──────────────────────────────────╯
source