Being able to identify object classes and types is a really useful ability.
isinstance(<object>, <class>)
Tells you whether or not something is an instance of a particular class.
>>> isinstance('a', str)
True
>>> isinstance(5.2, (int, float))
True
>>> isinstance(5.2, (str, bool, dict))
False
>>> isinstance(True, int)
True
issubclass(<class>, <class>)
Tells you whether or not something is an instance of a particular class.
>>> issubclass(bool, int)
True
>>> issubclass(str, int)
False
>>> issublcass(Thief, Character)
True
type(<instance>)
The type function tells you the type of object that an instance is.
type(kenneth)
<class 'thieves.Thief'>
>>> kenneth.__class__
<class 'thieves.Thief'>
>>> kenneth.__class__.__name__
'Thief'