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

Function is_instance

Lib/test/test_unittest/testmock/support.py:4–6  ·  view source on GitHub ↗

Version of is_instance that doesn't access __class__

(obj, klass)

Source from the content-addressed store, hash-verified

2
3
4def is_instance(obj, klass):
5 """Version of is_instance that doesn't access __class__"""
6 return issubclass(type(obj), klass)
7
8
9class SomeClass(object):

Callers 12

test_constructorMethod · 0.90
test_callMethod · 0.90
assertNotCallableMethod · 0.90
testMethod · 0.90
_testMethod · 0.90
_testMethod · 0.90
assertNotCallableMethod · 0.90

Calls

no outgoing calls

Tested by 12

test_constructorMethod · 0.72
test_callMethod · 0.72
assertNotCallableMethod · 0.72
testMethod · 0.72
_testMethod · 0.72
_testMethod · 0.72
assertNotCallableMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…