Instead of checking for str and unicode separately, use:
Update: Use:
>>> from types import StringTypesOtherwise, this was an extremely basic talk.
>>> isinstance("", StringTypes)
True
Update: Use:
>>> isinstance("", basestring)Thanks, Bob Ippolito!
True
Comments