support.py 268 B

12345678910111213141516
  1. target = {'foo': 'FOO'}
  2. def is_instance(obj, klass):
  3. """Version of is_instance that doesn't access __class__"""
  4. return issubclass(type(obj), klass)
  5. class SomeClass(object):
  6. class_attribute = None
  7. def wibble(self): pass
  8. class X(object):
  9. pass