rsgalloway / pyseq

Compressed sequence string module for Python
https://pyseq.rsgalloway.com/
Other
123 stars 36 forks source link

String comparison #30

Closed broganross closed 7 years ago

broganross commented 7 years ago

This is a tiny change but it's been bugging me lately. Usually when you're testing if a variable is of string type you use basestring. That way it will catch unicode strings.

>>> s = "something"
>>> isinstance(s, basestring)
True
>>> s = u"something"
>>> isinstance(s, basestring)
True
>>> isinstance(s, str)
False