concepts.dsl.dsl_functions#

Data structures representing functions in a DSL.

Most importantly, this file contains the following classes:

  • FunctionType: the underlying type of a function, including argument types and return types.

  • Function: the function object, which is a callable object that can be used in expressions. They have names and types.

This file also implements a data structure for overloaded functions: OverloadedFunctionType. Internally, it contains a list of FunctionType objects, and it is used to represent overloaded functions. There are a few argument resolution methods implemented for both FunctionType and OverloadedFunctionType.

Module attributes

get_function_argument_resolution_context()

Get the current option context.

FunctionArgumentUnset

A placeholder indicating that the argument is not specified.

FunctionArgumentType

Acceptable types for function arguments.

FunctionArgumentListType

Acceptable types for function argument lists.

FunctionReturnType

Acceptable types for function return types.

Classes

AnonymousFunctionArgumentGenerator

A generator for anonymous function arguments.

Function

A function object holds a function type and an optional overridden __call__.

FunctionArgumentResolutionContext

A context manager for controlling the function argument resolution.

FunctionDerivedExpressionList

A data structure that holds multiple derived expressions for a function.

FunctionOverriddenCallList

A data structure that holds multiple overridden __call__ implementations for a function.

FunctionResolvedFromRecord

FunctionResolvedFromRecord(function: Callable, ftype_index: Union[int, Tuple[int, ...]])

FunctionType

FunctionType defines the signature of a function.

OverloadedFunctionAmbiguousResolutions

OverloadedFunctionResolution

The data structure for storing the result of resolving an overloaded function.

OverloadedFunctionType

Exceptions

FunctionArgumentResolutionError

Exception raised when the function argument resolution fails.