code: def isString(s):
      
      try:
          return isinstance(s, unicode) or isinstance(s, basestring)
      except NameError:
          return isinstance(s, str)
docs: Convenience method that works with all 2.x versions of Python
      to determine whether or not something is stringlike.