code: def to_str(v, encode=None):
      
      if isinstance(v, basestring_type):
          return v
  
      if isinstance(v, dict):
          return to_dict_str(v, encode)
  
      if isinstance(v, Iterable):
          return to_list_str(v, encode)
  
      if encode:
          return encode(v)
      else:
          return default_encode(v)
docs: convert any list, dict, iterable and primitives object to string