class documentation

class ExpandTypeVisitor(TypeVisitor[Type]): (source)

View In Hierarchy

Visitor that substitutes type variables with values.

Method __init__ Undocumented
Method expand_types Undocumented
Method expand_types_with_unpack Expands a list of types that has an unpack.
Method expand_unpack Undocumented
Method interpolate_args_for_unpack Undocumented
Method visit_any Undocumented
Method visit_callable_type Undocumented
Method visit_deleted_type Undocumented
Method visit_erased_type Undocumented
Method visit_instance Undocumented
Method visit_literal_type Undocumented
Method visit_none_type Undocumented
Method visit_overloaded Undocumented
Method visit_param_spec Undocumented
Method visit_parameters Undocumented
Method visit_partial_type Undocumented
Method visit_tuple_type Undocumented
Method visit_type_alias_type Undocumented
Method visit_type_type Undocumented
Method visit_type_var Undocumented
Method visit_type_var_tuple Undocumented
Method visit_typeddict_type Undocumented
Method visit_unbound_type Undocumented
Method visit_uninhabited_type Undocumented
Method visit_union_type Undocumented
Method visit_unpack_type Undocumented
Instance Variable allow_erased_callables Undocumented
Instance Variable variables Undocumented
def __init__(self, variables: Mapping[TypeVarId, Type], allow_erased_callables: bool = False): (source)

Undocumented

def expand_types(self, types: Iterable[Type]) -> list[Type]: (source)

Undocumented

def expand_types_with_unpack(self, typs: Sequence[Type]) -> ((list[Type]|AnyType)|UninhabitedType)|Instance: (source)

Expands a list of types that has an unpack. In corner cases, this can return a type rather than a list, in which case this indicates use of Any or some error occurred earlier. In this case callers should simply propagate the resulting type.

def expand_unpack(self, t: UnpackType) -> ((list[Type]|Instance)|AnyType)|None: (source)

Undocumented

def interpolate_args_for_unpack(self, t: CallableType, var_arg: UnpackType) -> tuple[list[str|None], list[ArgKind], list[Type]]: (source)

Undocumented

def visit_any(self, t: AnyType) -> Type: (source)

Undocumented

def visit_callable_type(self, t: CallableType) -> Type: (source)

Undocumented

def visit_deleted_type(self, t: DeletedType) -> Type: (source)

Undocumented

def visit_erased_type(self, t: ErasedType) -> Type: (source)

Undocumented

def visit_instance(self, t: Instance) -> Type: (source)

Undocumented

def visit_literal_type(self, t: LiteralType) -> Type: (source)

Undocumented

def visit_none_type(self, t: NoneType) -> Type: (source)

Undocumented

def visit_overloaded(self, t: Overloaded) -> Type: (source)

Undocumented

def visit_param_spec(self, t: ParamSpecType) -> Type: (source)

Undocumented

def visit_parameters(self, t: Parameters) -> Type: (source)

Undocumented

def visit_partial_type(self, t: PartialType) -> Type: (source)

Undocumented

def visit_tuple_type(self, t: TupleType) -> Type: (source)

Undocumented

def visit_type_alias_type(self, t: TypeAliasType) -> Type: (source)

Undocumented

def visit_type_type(self, t: TypeType) -> Type: (source)

Undocumented

def visit_type_var(self, t: TypeVarType) -> Type: (source)

Undocumented

def visit_type_var_tuple(self, t: TypeVarTupleType) -> Type: (source)

Undocumented

def visit_typeddict_type(self, t: TypedDictType) -> Type: (source)

Undocumented

def visit_unbound_type(self, t: UnboundType) -> Type: (source)

Undocumented

def visit_uninhabited_type(self, t: UninhabitedType) -> Type: (source)

Undocumented

def visit_union_type(self, t: UnionType) -> Type: (source)

Undocumented

def visit_unpack_type(self, t: UnpackType) -> Type: (source)

Undocumented

allow_erased_callables = (source)

Undocumented

variables = (source)

Undocumented