concepts.dsl.dsl_functions.OverloadedFunctionType#

class OverloadedFunctionType[source]#

Bases: TypeBase

Methods

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.

from_function_type_with_union_arguments(...)

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.

short_str()

Return the short string representation of the type.

Attributes

alias

An optional alias of the type.

is_list_type

Return whether the type is a list type.

nr_types

Return the number of sub-types.

parent_type

The parent type of the type.

parent_typename

Return the typename of the parent type.

typename

The (full) typename of the type.

types

__init__(types, alias=None)[source]#

Initialize the type.

Parameters:
__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.

Parameters:
  • other (TypeBase) – the other type.

  • allow_self_list (bool) – if True, this type can be a list type derived from the other type.

  • allow_list (bool) – if True, the other type can be a list type derived from the type.

Return type:

bool

classmethod from_function_type_with_union_arguments(function_type)[source]#

Create an OverloadedFunctionType from a FunctionType with Union-Typed arguments.

Parameters:

function_type (FunctionType) –

long_str()#

Return the long string representation of the type.

Return type:

str

resolve_type_and_args(*args, **kwargs)[source]#

Resolve the exact sub-function type being called and the argument list.

Parameters:
  • *args (Any) – The positional arguments.

  • **kwargs (Any) – The keyword arguments.

Returns:

A OverloadedFunctionResolution object if the resolution is unambiguous, or a OverloadedFunctionAmbiguousResolutions object if the resolution is ambiguous. The ambiguity resolution object will only be returned if the check_overloaded_ambiguity flag is set to False in the FunctionArgumentResolutionContext.

Return type:

OverloadedFunctionResolution | OverloadedFunctionAmbiguousResolutions

short_str()#

Return the short string representation of the type.

Return type:

str

property alias: str | None#

An optional alias of the type.

property is_list_type#

Return whether the type is a list type.

property nr_types: int#

Return the number of sub-types.

property parent_type: TypeBase | None#

The parent type of the type.

property parent_typename#

Return the typename of the parent type.

property typename: str#

The (full) typename of the type.

types: Tuple[FunctionType]#