Use duck-typing rather than relying on six's string_types