Closed jmsv closed 6 years ago
At the moment, checking a value is a string looks like this:
isinstance(word, ("".__class__, u"".__class__))
This is probably a dodgy way of doing it and since this package maintains compatibility with Python 2 and 3, it makes sense to start using six.
This would simplify string checking to:
isinstance(word, six.string_types)
From https://pythonhosted.org/six/#six.string_types:
__six.string_types__ Possible types for text data. This is basestring() in Python 2 and str in Python 3.
six.string_types
At the moment, checking a value is a string looks like this:
This is probably a dodgy way of doing it and since this package maintains compatibility with Python 2 and 3, it makes sense to start using six.
This would simplify string checking to:
From https://pythonhosted.org/six/#six.string_types: