def get_dict_attr(obj, attr, default=None):
 for obj in ([obj] + obj.__class__.mro()):
  if (attr in obj.__dict__):
   return obj.__dict__[attr]
 return default

def get_dict_attr ( obj , attr , default = None ) : for obj in ( [ obj ] + obj . __class__ . mro ( ) ) : if ( attr in obj . __dict__ ) : return obj . __dict__ [ attr ] return default
get attribute of the object without triggering its __getattr__ .