Let\'s say that I have class, that uses some functionality of dict. I used to composite a dict object inside and provide some access from
class
dict
Should isinstance(my_object, dict) return True or False? In other words, if you accidentally give one of the objects to something that wants a dict, should it blithely try to use it as a dict? Probably not, so use composition.
isinstance(my_object, dict)