class documentation

class SnapshotTypeVisitor(TypeVisitor[SnapshotItem]): (source)

View In Hierarchy

Creates a read-only, self-contained snapshot of a type object. Properties of a snapshot: - Contains (nested) tuples and other immutable primitive objects only. - References to AST nodes are replaced with full names of targets. - Has no references to mutable or non-primitive objects. - Two snapshots represent the same object if and only if they are equal. - Results must be sortable. It's important that tuples have consistent types and can't arbitrarily mix str and None values, for example, since they can't be compared.

Method normalize_callable_variables Normalize all type variable ids to run from -1 to -len(variables).
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
def normalize_callable_variables(self, typ: CallableType) -> CallableType: (source)

Normalize all type variable ids to run from -1 to -len(variables).

def visit_any(self, typ: AnyType) -> SnapshotItem: (source)

Undocumented

def visit_callable_type(self, typ: CallableType) -> SnapshotItem: (source)

Undocumented

def visit_deleted_type(self, typ: DeletedType) -> SnapshotItem: (source)

Undocumented

def visit_erased_type(self, typ: ErasedType) -> SnapshotItem: (source)

Undocumented

def visit_instance(self, typ: Instance) -> SnapshotItem: (source)

Undocumented

def visit_literal_type(self, typ: LiteralType) -> SnapshotItem: (source)

Undocumented

def visit_none_type(self, typ: NoneType) -> SnapshotItem: (source)

Undocumented

def visit_overloaded(self, typ: Overloaded) -> SnapshotItem: (source)

Undocumented

def visit_param_spec(self, typ: ParamSpecType) -> SnapshotItem: (source)

Undocumented

def visit_parameters(self, typ: Parameters) -> SnapshotItem: (source)

Undocumented

def visit_partial_type(self, typ: PartialType) -> SnapshotItem: (source)

Undocumented

def visit_tuple_type(self, typ: TupleType) -> SnapshotItem: (source)

Undocumented

def visit_type_alias_type(self, typ: TypeAliasType) -> SnapshotItem: (source)

Undocumented

def visit_type_type(self, typ: TypeType) -> SnapshotItem: (source)

Undocumented

def visit_type_var(self, typ: TypeVarType) -> SnapshotItem: (source)

Undocumented

def visit_type_var_tuple(self, typ: TypeVarTupleType) -> SnapshotItem: (source)

Undocumented

def visit_typeddict_type(self, typ: TypedDictType) -> SnapshotItem: (source)

Undocumented

def visit_unbound_type(self, typ: UnboundType) -> SnapshotItem: (source)

Undocumented

def visit_uninhabited_type(self, typ: UninhabitedType) -> SnapshotItem: (source)

Undocumented

def visit_union_type(self, typ: UnionType) -> SnapshotItem: (source)

Undocumented

def visit_unpack_type(self, typ: UnpackType) -> SnapshotItem: (source)

Undocumented