def get_properties(obj):
 if hasattr(obj, 'keys'):
  return obj.keys()
 elif hasattr(obj, '__dict__'):
  return obj.__dict__.keys()
 return []

def get_properties ( obj ) : if hasattr ( obj , 'keys' ) : return obj . keys ( ) elif hasattr ( obj , '__dict__' ) : return obj . __dict__ . keys ( ) return [ ]
returns a list of properties for l{obj} @since: 0 .