code: def class_to_str(obj):
      
      mod_str = obj.__module__
      name_str = obj.__name__
      if mod_str == '__main__':
          return name_str
      else:
          return '.'.join([mod_str, name_str])
docs: get class string from object
  
      Examples
      --------
  
      >>> class_to_str(list).split('.')[1]
      'list'