Calculation of the least upper bound types (joins).
Class |
|
Undocumented |
Class |
|
Implementation of the least upper bound algorithm. |
Function | combine |
Produces a list of argument names compatible with both callables. |
Function | combine |
Undocumented |
Function | is |
Undocumented |
Function | is |
Return True if t and s have identical numbers of arguments, default arguments and varargs. |
Function | join |
Undocumented |
Function | join |
Return a simple least upper bound given the declared type. |
Function | join |
Undocumented |
Function | join |
Return the least upper bound of s and t. |
Function | normalize |
Undocumented |
Function | object |
Construct the type 'builtins.object' from an instance type. |
Function | object |
Undocumented |
Function | trivial |
Return one of types (expanded) if it is a supertype of other, otherwise top type. |
Function | unpack |
Undocumented |
Produces a list of argument names compatible with both callables. For example, suppose 't' and 's' have the following signatures: - t: (a: int, b: str, X: str) -> None - s: (a: int, b: str, Y: str) -> None 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.
Return a simple least upper bound given the declared type. This function should be only used by binder, and should not recurse. For all other uses, use `join_types()`.
ProperType
, t: ProperType
, instance_joiner: InstanceJoiner|None
= None) -> ProperType
:(source) ¶
Return the least upper bound of s and t. For example, the join of 'int' and 'object' is 'object'.