MCPcopy Index your code
hub / github.com/python/cpython / _callable

Function _callable

Lib/unittest/mock.py:154–161  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

152
153
154def _callable(obj):
155 if isinstance(obj, type):
156 return True
157 if isinstance(obj, (staticmethod, classmethod, MethodType)):
158 return _callable(obj.__func__)
159 if getattr(obj, '__call__', None) is not None:
160 return True
161 return False
162
163
164def _is_list(obj):

Callers 10

test_typeMethod · 0.90
test_staticmethodMethod · 0.90
test_classmethodMethod · 0.90
_try_iterFunction · 0.85
_execute_mock_callMethod · 0.85
_execute_mock_callMethod · 0.85
create_autospecFunction · 0.85

Calls

no outgoing calls

Tested by 6

test_typeMethod · 0.72
test_staticmethodMethod · 0.72
test_classmethodMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…