MethodInspector.jl Documentation
MethodInspector
— ModuleInspect the names and types of positional and keyword arguments to a method
Exported Functions
MethodInspector.arg_names
— Methodarg_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)
MethodInspector.arg_types
— Methodarg_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)
MethodInspector.kwarg_names
— Methodkwarg_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))
MethodInspector.kwarg_types
— Methodkwarg_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)
MethodInspector.unwrap_all
— MethodGeneric method to call the appropriate unwrapper for the given type
MethodInspector.unwrap_typevar
— MethodUnwrap a TypeVar
into its upper type
MethodInspector.unwrap_union
— MethodUnwrap the components of a Union
type to non-parametrized types