module documentation

Undocumented

Class EraseTypeVisitor Undocumented
Class LastKnownValueEraser Removes the Literal[...] type that may be associated with any Instance types.
Class TypeVarEraser 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: Type) -> ProperType: (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]

def erase_typevars(t: Type, ids_to_erase: Container[TypeVarId]|None = None) -> Type: (source)

Replace all type variables in a type with any, or just the ones in the provided collection.

def remove_instance_last_known_values(t: Type) -> Type: (source)

Undocumented

def replace_meta_vars(t: Type, target_type: Type) -> Type: (source)

Replace unification variables in a type with the target type.