We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bcd47fe commit 17d7616Copy full SHA for 17d7616
imas/ids_structure.py
@@ -1,7 +1,6 @@
1
# This file is part of IMAS-Python.
2
# You should have received the IMAS-Python LICENSE file with this project.
3
-"""A structure in an IDS
4
-"""
+"""A structure in an IDS"""
5
6
import logging
7
from copy import deepcopy
@@ -151,7 +150,9 @@ def __deepcopy__(self, memo):
151
150
for child in self._children:
152
if child in self.__dict__:
153
child_copy = deepcopy(getattr(self, child), memo)
154
- setattr(copy, child, child_copy)
+ # bypass __setattr__:
+ copy.__dict__[child] = child_copy
155
+ child_copy._parent = copy
156
return copy
157
158
def __dir__(self) -> List[str]:
0 commit comments