This whole condition is equivalent to `isinstance(self.user, pymysql._compat.text_type)`, which should be preferred.