class documentation

class ConstraintBuilderVisitor(TypeVisitor[List[Constraint]]): (source)

View In Hierarchy

Visitor class for inferring type constraints.
Method __init__ Undocumented
Method infer​_against​_any Undocumented
Method infer​_against​_overloaded Undocumented
Method infer​_constraints​_from​_protocol​_members Infer constraints for situations where either 'template' or 'instance' is a protocol.
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​_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​_typeddict​_type Undocumented
Method visit​_unbound​_type Undocumented
Method visit​_uninhabited​_type Undocumented
Method visit​_union​_type Undocumented
Instance Variable actual Undocumented
Instance Variable direction Undocumented
def __init__(self, actual, direction): (source)

Undocumented

Parameters
actual:ProperTypeUndocumented
direction:intUndocumented
def infer_against_any(self, types, any_type): (source)

Undocumented

Parameters
types:Iterable[Type]Undocumented
any​_type:AnyTypeUndocumented
Returns
List[Constraint]Undocumented
def infer_against_overloaded(self, overloaded, template): (source)

Undocumented

Parameters
overloaded:OverloadedUndocumented
template:CallableTypeUndocumented
Returns
List[Constraint]Undocumented
def infer_constraints_from_protocol_members(self, instance, template, subtype, protocol): (source)

Infer constraints for situations where either 'template' or 'instance' is a protocol.

The 'protocol' is the one of two that is an instance of protocol type, 'subtype' is the type used to bind self during inference. Currently, we just infer constrains for every protocol member type (both ways for settable members).

Parameters
instance:InstanceUndocumented
template:InstanceUndocumented
subtype:TypeUndocumented
protocol:InstanceUndocumented
Returns
List[Constraint]Undocumented
def visit_any(self, template): (source)

Undocumented

Parameters
template:AnyTypeUndocumented
Returns
List[Constraint]Undocumented
def visit_callable_type(self, template): (source)

Undocumented

Parameters
template:CallableTypeUndocumented
Returns
List[Constraint]Undocumented
def visit_deleted_type(self, template): (source)

Undocumented

Parameters
template:DeletedTypeUndocumented
Returns
List[Constraint]Undocumented
def visit_erased_type(self, template): (source)

Undocumented

Parameters
template:ErasedTypeUndocumented
Returns
List[Constraint]Undocumented
def visit_instance(self, template): (source)

Undocumented

Parameters
template:InstanceUndocumented
Returns
List[Constraint]Undocumented
def visit_literal_type(self, template): (source)

Undocumented

Parameters
template:LiteralTypeUndocumented
Returns
List[Constraint]Undocumented
def visit_none_type(self, template): (source)

Undocumented

Parameters
template:NoneTypeUndocumented
Returns
List[Constraint]Undocumented
def visit_overloaded(self, template): (source)

Undocumented

Parameters
template:OverloadedUndocumented
Returns
List[Constraint]Undocumented
def visit_param_spec(self, template): (source)

Undocumented

Parameters
template:ParamSpecTypeUndocumented
Returns
List[Constraint]Undocumented
def visit_partial_type(self, template): (source)

Undocumented

Parameters
template:PartialTypeUndocumented
Returns
List[Constraint]Undocumented
def visit_tuple_type(self, template): (source)

Undocumented

Parameters
template:TupleTypeUndocumented
Returns
List[Constraint]Undocumented
def visit_type_alias_type(self, template): (source)

Undocumented

Parameters
template:TypeAliasTypeUndocumented
Returns
List[Constraint]Undocumented
def visit_type_type(self, template): (source)

Undocumented

Parameters
template:TypeTypeUndocumented
Returns
List[Constraint]Undocumented
def visit_type_var(self, template): (source)

Undocumented

Parameters
template:TypeVarTypeUndocumented
Returns
List[Constraint]Undocumented
def visit_typeddict_type(self, template): (source)

Undocumented

Parameters
template:TypedDictTypeUndocumented
Returns
List[Constraint]Undocumented
def visit_unbound_type(self, template): (source)

Undocumented

Parameters
template:UnboundTypeUndocumented
Returns
List[Constraint]Undocumented
def visit_uninhabited_type(self, template): (source)

Undocumented

Parameters
template:UninhabitedTypeUndocumented
Returns
List[Constraint]Undocumented
def visit_union_type(self, template): (source)

Undocumented

Parameters
template:UnionTypeUndocumented
Returns
List[Constraint]Undocumented
actual = (source)

Undocumented

direction = (source)

Undocumented