code: def is_str(string):
      
      if sys.version_info[:2] >= (3, 0):
          return isinstance(string, str)
  
      return isinstance(string, basestring)
docs: Python 2 and 3 compatible string checker.
  
      Args:
          string (str | basestring): the string to check
  
      Returns:
          bool: True or False