module documentation
(source)

Undocumented

Class ​Erase​Type​Visitor Undocumented
Class ​Last​Known​Value​Eraser Removes the Literal[...] type that may be associated with any Instance types.
Class ​Type​Var​Eraser Implementation of type erasure
Function erase​_type Erase any type variables from a type.
Function erase​_typevars Replace all type variables in a type with any, or just the ones in the provided collection.
Function remove​_instance​_last​_known​_values Undocumented
Function replace​_meta​_vars Replace unification variables in a type with the target type.
def erase_type(typ): (source)

Erase any type variables from a type.

Also replace tuple types with the corresponding concrete types.

Examples:
A -> A B[X] -> B[Any] Tuple[A, B] -> tuple Callable[[A1, A2, ...], R] -> Callable[..., Any] Type[X] -> Type[Any]
Parameters
typ:TypeUndocumented
Returns
ProperTypeUndocumented
def erase_typevars(t, ids_to_erase=None): (source)
Replace all type variables in a type with any, or just the ones in the provided collection.
Parameters
t:TypeUndocumented
ids​_to​_erase:Optional[Container[TypeVarId]]Undocumented
Returns
TypeUndocumented
def remove_instance_last_known_values(t): (source)

Undocumented

Parameters
t:TypeUndocumented
Returns
TypeUndocumented
def replace_meta_vars(t, target_type): (source)
Replace unification variables in a type with the target type.
Parameters
t:TypeUndocumented
target​_type:TypeUndocumented
Returns
TypeUndocumented