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

Function safe_join

mypy/join.py:785–792  ·  view source on GitHub ↗
(t: Type, s: Type)

Source from the content-addressed store, hash-verified

783
784
785def safe_join(t: Type, s: Type) -> Type:
786 # This is a temporary solution to prevent crashes in combine_similar_callables() etc.,
787 # until relevant TODOs on handling arg_kinds will be addressed there.
788 if not isinstance(t, UnpackType) and not isinstance(s, UnpackType):
789 return join_types(t, s)
790 if isinstance(t, UnpackType) and isinstance(s, UnpackType):
791 return UnpackType(join_types(t.type, s.type))
792 return object_or_any_from_type(get_proper_type(t))
793
794
795def safe_meet(t: Type, s: Type) -> Type:

Callers 2

meet_similar_callablesFunction · 0.90

Calls 5

UnpackTypeClass · 0.90
get_proper_typeFunction · 0.90
isinstanceFunction · 0.85
join_typesFunction · 0.85
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…