If you’re writing 2.x-and-3.x-compatible code, you’ll probably want to use six:
from six import string_types
isinstance(s, string_types)
If you’re writing 2.x-and-3.x-compatible code, you’ll probably want to use six:
from six import string_types
isinstance(s, string_types)