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

Function unpack_callback_protocol

mypy/join.py:912–916  ·  view source on GitHub ↗
(t: Instance)

Source from the content-addressed store, hash-verified

910
911
912def unpack_callback_protocol(t: Instance) -> ProperType | None:
913 assert t.type.is_protocol
914 if t.type.protocol_members == ["__call__"]:
915 return get_proper_type(find_member("__call__", t, t, is_operator=True))
916 return None

Callers 3

visit_instanceMethod · 0.85
visit_callable_typeMethod · 0.85
visit_overloadedMethod · 0.85

Calls 2

get_proper_typeFunction · 0.90
find_memberFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…