1 2 3 4 5
--- tags: - python --- To have a class behave as a dict it's possible to add the two magic methods `__getitem__(self, key)` and `__setitem__(self, key, val)`.