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
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.