module documentation
(source)

Utilities for type argument inference.
Class ​Argument​Infer​Context 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, arg_types, arg_kinds, formal_to_actual, context, strict=True): (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

Parameters
callee​_type:CallableTypeUndocumented
arg​_types:Sequence[Optional[Type]]Undocumented
arg​_kinds:List[ArgKind]Undocumented
formal​_to​_actual:List[List[int]]Undocumented
context:ArgumentInferContextUndocumented
strict:boolUndocumented
Returns
List[Optional[Type]]Undocumented
def infer_type_arguments(type_var_ids, template, actual, is_supertype=False): (source)

Undocumented

Parameters
type​_var​_ids:List[TypeVarId]Undocumented
template:TypeUndocumented
actual:TypeUndocumented
is​_supertype:boolUndocumented
Returns
List[Optional[Type]]Undocumented