concepts.dsl.dsl_functions.OverloadedFunctionType#
- class OverloadedFunctionType[source]#
Bases:
TypeBase
Methods
Return the value type for assignment.
downcast_compatible
(other[, ...])Check if the type is downcast-compatible with the other type; that is, if this type is a subtype of the other type.
Create an OverloadedFunctionType from a FunctionType with Union-Typed arguments.
long_str
()Return the long string representation of the type.
resolve_type_and_args
(*args, **kwargs)Resolve the exact sub-function type being called and the argument list.
set_parent_type
(parent_type)Return the short string representation of the type.
Attributes
An optional alias of the type.
Return the typename of the base type.
Return whether the type is a multidimensional list type.
Return whether the type is a list type.
Return whether the type is an object type.
Return whether the type is a Python object value type.
Return whether the type is a sequence type.
Return whether the type is a tensor value type.
Return whether the type is a tuple type.
Return whether the type is a value type.
Return the number of sub-types.
The parent type of the type.
Return the typename of the parent type.
The (full) typename of the type.
- __init__(types, alias=None)[source]#
Initialize the type.
- Parameters:
typename – The name of the type.
alias (str | None) – The alias of the type.
types (Sequence[OverloadedFunctionType | FunctionType])
- __new__(**kwargs)#
- downcast_compatible(other, allow_self_list=False, allow_list=False)#
Check if the type is downcast-compatible with the other type; that is, if this type is a subtype of the other type.
- classmethod from_function_type_with_union_arguments(function_type)[source]#
Create an OverloadedFunctionType from a FunctionType with Union-Typed arguments.
- Parameters:
function_type (FunctionType)
- resolve_type_and_args(*args, **kwargs)[source]#
Resolve the exact sub-function type being called and the argument list.
- Parameters:
- Returns:
A
OverloadedFunctionResolution
object if the resolution is unambiguous, or aOverloadedFunctionAmbiguousResolutions
object if the resolution is ambiguous. The ambiguity resolution object will only be returned if thecheck_overloaded_ambiguity
flag is set to False in theFunctionArgumentResolutionContext
.The
OverloadedFunctionResolution
object contains the index of the sub-function type being called, the sub-function type, and the resolved argument list.The
OverloadedFunctionAmbiguousResolutions
object contains a list ofOverloadedFunctionResolution
objects.
- Return type:
OverloadedFunctionResolution | OverloadedFunctionAmbiguousResolutions
- property base_typename#
Return the typename of the base type.
- property parent_typename#
Return the typename of the parent type.
- types: Tuple[FunctionType]#