1target = {'foo': 'FOO'} 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): 10 class_attribute = None 11 12 def wibble(self): pass 13 14 15class X(object): 16 pass 17