def is_text_string(obj):
 if PY2:
  return isinstance(obj, basestring)
 else:
  return isinstance(obj, str)

def is_text_string ( obj ) : if PY2 : return isinstance ( obj , basestring ) else : return isinstance ( obj , str )
return true if obj is a text string .