@@ -118,6 +118,19 class GenericData(object): | |||
|
118 | 118 | return copy.deepcopy(self) |
|
119 | 119 | |
|
120 | 120 | for key in inputObj.__dict__.keys(): |
|
121 | ||
|
122 | attribute = inputObj.__dict__[key] | |
|
123 | ||
|
124 | #If this attribute is a tuple or list | |
|
125 | if type(inputObj.__dict__[key]) in (tuple, list): | |
|
126 | self.__dict__[key] = attribute[:] | |
|
127 | continue | |
|
128 | ||
|
129 | #If this attribute is another object or instance | |
|
130 | if hasattr(attribute, '__dict__'): | |
|
131 | self.__dict__[key] = attribute.copy() | |
|
132 | continue | |
|
133 | ||
|
121 | 134 | self.__dict__[key] = inputObj.__dict__[key] |
|
122 | 135 | |
|
123 | 136 | def deepcopy(self): |
General Comments 0
You need to be logged in to leave comments.
Login now