I have a standard Bunch class:
class Bunch(dict):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.__dict__ = self
This results in an attribute error:
a = Bunch(b=1)
a = copy.deepcopy(a)
a.b
Which does not make sense to me. The deepcopy() function destroys the functionality of Bunch.
But the really weird part is that adding more complexity fixes it, seemingly by accident:
I am using Jupyter Lab to run things. The following works without error:
a = Bunch(b=1)
%store a
%store -r a
a = copy.deepcopy(a)
a.b
Why?