⬅︎ Back to When to __deepcopy__ classes in Python
The reason you need to add __deepcopy__ is that your __getattr__ is buggy. Try changing it to this instead: def __getattr__(self, key): if key in self: return self[key] raise AttributeError(key)
Comment
The reason you need to add __deepcopy__ is that your __getattr__ is buggy. Try changing it to this instead:
def __getattr__(self, key):
if key in self:
return self[key]
raise AttributeError(key)