Class | InstanceJoiner |
Undocumented |
Class | TypeJoinVisitor |
Implementation of the least upper bound algorithm. |
Function | combine_arg_names |
Produces a list of argument names compatible with both callables. |
Function | combine_similar_callables |
Undocumented |
Function | is_better |
Undocumented |
Function | is_similar_callables |
Return True if t and s have identical numbers of arguments, default arguments and varargs. |
Function | join_similar_callables |
Undocumented |
Function | join_simple |
Return a simple least upper bound given the declared type. |
Function | join_type_list |
Undocumented |
Function | join_types |
Return the least upper bound of s and t. |
Function | object_from_instance |
Construct the type 'builtins.object' from an instance type. |
Function | object_or_any_from_type |
Undocumented |
Function | trivial_join |
Return one of types (expanded) if it is a supertype of other, otherwise top type. |
Function | unpack_callback_protocol |
Undocumented |
Produces a list of argument names compatible with both callables.
For example, suppose 't' and 's' have the following signatures:
This function would return ["a", "b", None]. This information is then used above to compute the join of t and s, which results in a signature of (a: int, b: str, str) -> None.
Note that the third argument's name is omitted and 't' and 's' are both valid subtypes of this inferred signature.
Precondition: is_similar_types(t, s) is true.
Parameters | |
t:CallableType | Undocumented |
s:CallableType | Undocumented |
Returns | |
List[ | Undocumented |
Undocumented
Parameters | |
t:CallableType | Undocumented |
s:CallableType | Undocumented |
Returns | |
CallableType | Undocumented |
Parameters | |
t:CallableType | Undocumented |
s:CallableType | Undocumented |
Returns | |
bool | Undocumented |
Undocumented
Parameters | |
t:CallableType | Undocumented |
s:CallableType | Undocumented |
Returns | |
CallableType | Undocumented |
Parameters | |
declaration:Optional[ | Undocumented |
s:Type | Undocumented |
t:Type | Undocumented |
Returns | |
ProperType | Undocumented |
Return the least upper bound of s and t.
For example, the join of 'int' and 'object' is 'object'.
Parameters | |
s:Type | Undocumented |
t:Type | Undocumented |
instance_joiner:Optional[ | Undocumented |
Returns | |
ProperType | Undocumented |
Parameters | |
s:Type | Undocumented |
t:Type | Undocumented |
Returns | |
ProperType | Undocumented |