There's no need to check it in Python, but if you still want to check it isinstance(o, str) it will return true if o is a string or inherits from str.
type(o) is str will return true only if o is str , or false if o inherits a type str.
Hope this helps.