module documentation

Utilities for type argument inference.

Class ArgumentInferContext Type argument inference context.
Function infer_function_type_arguments Infer the type arguments of a generic function.
Function infer_type_arguments Undocumented
def infer_function_type_arguments(callee_type: CallableType, arg_types: Sequence[Type|None], arg_kinds: list[ArgKind], formal_to_actual: list[list[int]], context: ArgumentInferContext, strict: bool = True) -> list[Type|None]: (source)

Infer the type arguments of a generic function. Return an array of lower bound types for the type variables -1 (at index 0), -2 (at index 1), etc. A lower bound is None if a value could not be inferred. Arguments: callee_type: the target generic function arg_types: argument types at the call site (each optional; if None, we are not considering this argument in the current pass) arg_kinds: nodes.ARG_* values for arg_types formal_to_actual: mapping from formal to actual variable indices

def infer_type_arguments(type_var_ids: list[TypeVarId], template: Type, actual: Type, is_supertype: bool = False) -> list[Type|None]: (source)

Undocumented