Basically I want to do this:
obj = \'str\' type ( obj ) == string
I tried:
type ( obj ) == type ( string )
Type doesn't work on certain classes. If you're not sure of the object's type use the __class__ method, as so:
__class__
>>>obj = 'a string' >>>obj.__class__ == str True
Also see this article - http://www.siafoo.net/article/56