MethodInspector.jl Documentation

MethodInspectorModule

Inspect the names and types of positional and keyword arguments to a method

source

Exported Functions

MethodInspector.arg_namesMethod
  • arg_names(::Method)Symbol[]

Given a method, return a list of args required by that method.

Arguments

m::Method : The Method or MethodList to check for args

Returns

A Symbol array of the args required by the first method passed in. Arg types and default values are not returned. Functions with no required args will return an empty array.

Examples

arg_names(foo)
source
MethodInspector.arg_typesMethod
  • arg_types(::Method)Type[]

Given a method, return the datatype of all its positional arguments.

Arguments

m::Method : The Method or MethodList to check for args

Returns

A Type array of the arg types supported by method m. Arg names can be fetched using arg_names. Both functions will return values in the same order. Methods that do not support args will return an empty array.

Examples

arg_types(foo)
source
MethodInspector.kwarg_namesMethod
  • kwarg_names(::Method)Symbol[]

Given a method, return the names of all Keyword Arguments of that method.

Arguments

m::Method : The method to check for kwargs

Returns

A Symbol array of the kwargs supported by method m. Arg types can be fetched using kwarg_types which returns types in the same order. Default values are not returned. Methods that do not support kwargs will return an empty array.

Examples

kwarg_names(methods(foo).ms[1])

kwarg_names(methods(foo, (Int,), MyModule))
source
MethodInspector.kwarg_typesMethod
  • kwarg_types(::Method)Type[]

Given a Method, return a list of types of the keyword warguments supported by that method.

Arguments

m::Method : The method to check for kwargs

Returns

A Type array of the kwarg types supported by method m. Arg names can be fetched using kwarg_names. Both functions will return values in the same order. Methods that do not support kwargs will return an empty array.

Examples

kwarg_types(foo)
source

Index