I want to write a custom class that behaves like dict - so, I am inheriting from dict.
dict
My question, though, is: Do I need to create a priva
Here is an alternative solution:
class AttrDict(dict): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.__dict__ = self a = AttrDict() a.a = 1 a.b = 2