class documentation

Visitor for performing queries of types. strategy is used to combine results for a series of types, common use cases involve a boolean query using `any` or `all`. Note: this visitor keeps an internal state (tracks type aliases to avoid recursion), so it should *never* be re-used for querying different types, create a new visitor instance instead. # TODO: check that we don't have existing violations of this rule.

Method __init__ Undocumented
Method query_types Perform a query for a list of types using the strategy to combine the results.
Method visit_any Undocumented
Method visit_callable_argument Undocumented
Method visit_callable_type Undocumented
Method visit_deleted_type Undocumented
Method visit_ellipsis_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_placeholder_type Undocumented
Method visit_raw_expression_type Undocumented
Method visit_tuple_type Undocumented
Method visit_type_alias_type Undocumented
Method visit_type_list 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 seen_aliases Undocumented
Instance Variable skip_alias_target Undocumented
Instance Variable strategy Undocumented
def __init__(self, strategy: Callable[[list[T]], T]): (source)

Undocumented

def query_types(self, types: Iterable[Type]) -> T: (source)

Perform a query for a list of types using the strategy to combine the results.

def visit_any(self, t: AnyType) -> T: (source)
def visit_callable_argument(self, t: CallableArgument) -> T: (source)
def visit_callable_type(self, t: CallableType) -> T: (source)
def visit_deleted_type(self, t: DeletedType) -> T: (source)
def visit_ellipsis_type(self, t: EllipsisType) -> T: (source)
def visit_erased_type(self, t: ErasedType) -> T: (source)
def visit_instance(self, t: Instance) -> T: (source)
def visit_literal_type(self, t: LiteralType) -> T: (source)
def visit_none_type(self, t: NoneType) -> T: (source)
def visit_overloaded(self, t: Overloaded) -> T: (source)
def visit_param_spec(self, t: ParamSpecType) -> T: (source)
def visit_parameters(self, t: Parameters) -> T: (source)
def visit_partial_type(self, t: PartialType) -> T: (source)
def visit_placeholder_type(self, t: PlaceholderType) -> T: (source)
def visit_raw_expression_type(self, t: RawExpressionType) -> T: (source)
def visit_tuple_type(self, t: TupleType) -> T: (source)
def visit_type_alias_type(self, t: TypeAliasType) -> T: (source)
def visit_type_list(self, t: TypeList) -> T: (source)
def visit_type_type(self, t: TypeType) -> T: (source)
def visit_type_var(self, t: TypeVarType) -> T: (source)
def visit_type_var_tuple(self, t: TypeVarTupleType) -> T: (source)
def visit_typeddict_type(self, t: TypedDictType) -> T: (source)
def visit_unbound_type(self, t: UnboundType) -> T: (source)
def visit_uninhabited_type(self, t: UninhabitedType) -> T: (source)
def visit_union_type(self, t: UnionType) -> T: (source)
def visit_unpack_type(self, t: UnpackType) -> T: (source)

Undocumented

skip_alias_target: bool = (source)

Undocumented

strategy = (source)

Undocumented