module documentation

Undocumented

Class ExpandTypeVisitor Visitor that substitutes type variables with values.
Class FreshenCallableVisitor Undocumented
Class HasGenericCallable Undocumented
Function expand_self_type Expand appearances of Self type in a variable type.
Function expand_type Substitute any type variable references in a type given by a type environment.
Function expand_type_by_instance Substitute type variables in type using values from an Instance. Type variables are considered to be bound by the class declaration.
Function expand_unpack_with_variables May return either a list of types to unpack to, any, or a single variable length tuple. The latter may not be valid in all contexts.
Function freshen_all_functions_type_vars Undocumented
Function freshen_function_type_vars Substitute fresh type variables for generic function type variables.
Constant has_generic_callable Undocumented
Type Variable F Undocumented
Type Variable T Undocumented
@overload
def expand_self_type(var: Var, typ: ProperType, replacement: ProperType) -> ProperType:
@overload
def expand_self_type(var: Var, typ: Type, replacement: Type) -> Type:
(source)

Expand appearances of Self type in a variable type.

@overload
def expand_type(typ: ProperType, env: Mapping[TypeVarId, Type], allow_erased_callables: bool = ...) -> ProperType:
@overload
def expand_type(typ: Type, env: Mapping[TypeVarId, Type], allow_erased_callables: bool = ...) -> Type:
(source)

Substitute any type variable references in a type given by a type environment.

@overload
def expand_type_by_instance(typ: ProperType, instance: Instance) -> ProperType:
@overload
def expand_type_by_instance(typ: Type, instance: Instance) -> Type:
(source)

Substitute type variables in type using values from an Instance. Type variables are considered to be bound by the class declaration.

def expand_unpack_with_variables(t: UnpackType, variables: Mapping[TypeVarId, Type]) -> ((list[Type]|Instance)|AnyType)|None: (source)

May return either a list of types to unpack to, any, or a single variable length tuple. The latter may not be valid in all contexts.

def freshen_all_functions_type_vars(t: T) -> T: (source)

Undocumented

def freshen_function_type_vars(callee: F) -> F: (source)

Substitute fresh type variables for generic function type variables.

has_generic_callable = (source)

Undocumented

Value
HasGenericCallable()

Undocumented

Value
TypeVar('F',
        bound=FunctionLike)

Undocumented

Value
TypeVar('T',
        bound=Type)