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 5932a6f commit 7dc02cfCopy full SHA for 7dc02cf
src/Prototype/Conceptual/main.py
@@ -42,7 +42,7 @@ def __copy__(self):
42
43
return new
44
45
- def __deepcopy__(self, memo={}):
+ def __deepcopy__(self, memo=None):
46
"""
47
Create a deep copy. This method will be called whenever someone calls
48
`copy.deepcopy` with this object and the returned value is returned as
@@ -54,6 +54,8 @@ def __deepcopy__(self, memo={}):
54
to all the `deepcopy` calls you make in the `__deepcopy__` implementation
55
to prevent infinite recursions.
56
57
+ if memo is None:
58
+ memo = {}
59
60
# First, let's create copies of the nested objects.
61
some_list_of_objects = copy.deepcopy(self.some_list_of_objects, memo)
0 commit comments