def is_class_sealed(klass):
 mro = inspect.getmro(klass)
 new = False
 if (mro[(-1)] is object):
  mro = mro[:(-1)]
  new = True
 for kls in mro:
  if (new and ('__dict__' in kls.__dict__)):
   return False
  if (not hasattr(kls, '__slots__')):
   return False
 return True

def is_class_sealed ( klass ) : mro = inspect . getmro ( klass ) new = False if ( mro [ ( - 1 ) ] is object ) : mro = mro [ : ( - 1 ) ] new = True for kls in mro : if ( new and ( '__dict__' in kls . __dict__ ) ) : return False if ( not hasattr ( kls , '__slots__' ) ) : return False return True
whether or not the supplied class can accept dynamic properties .