def get_object_attrs(obj):
 attrs = [k for k in dir(obj) if (not k.startswith('__'))]
 if (not attrs):
  attrs = dir(obj)
 return attrs

def get_object_attrs ( obj ) : attrs = [ k for k in dir ( obj ) if ( not k . startswith ( '__' ) ) ] if ( not attrs ) : attrs = dir ( obj ) return attrs
get the attributes of an object using dir .