MCPcopy Index your code
hub / github.com/python/mypy / trivial_join

Function trivial_join

mypy/join.py:197–204  ·  view source on GitHub ↗

Return one of types (expanded) if it is a supertype of other, otherwise top type.

(s: Type, t: Type)

Source from the content-addressed store, hash-verified

195
196
197def trivial_join(s: Type, t: Type) -> Type:
198 """Return one of types (expanded) if it is a supertype of other, otherwise top type."""
199 if is_subtype(s, t):
200 return t
201 elif is_subtype(t, s):
202 return s
203 else:
204 return object_or_any_from_type(get_proper_type(t))
205
206
207@overload

Callers 1

join_typesFunction · 0.85

Calls 3

is_subtypeFunction · 0.90
get_proper_typeFunction · 0.90
object_or_any_from_typeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…