What is the best way to check whether a given object is of a given type? How about checking whether the object inherits from a given type?
Let\'s say I have an objec
A simple way to check type is to compare it with something whose type you know.
>>> a = 1 >>> type(a) == type(1) True >>> b = 'abc' >>> type(b) == type('') True