version of isinstance that doesn t access class return issubclasstypeobj klass class someclassobject classattribute none def wibbleself pass class xobject pass version of is_instance that doesn t access __class__
target = {'foo': 'FOO'}


def is_instance(obj, klass):
    
    return issubclass(type(obj), klass)


class SomeClass(object):
    class_attribute = None

    def wibble(self): pass


class X(object):
    pass