<s>[INST] How to find out if a Python object is a string? How can I check if a Python object is a string (either regular or Unicode)?
 [/INST] Python 2
Use isinstance(obj, basestring) for an object-to-test obj.
Docs.
 </s>