def __setitem__(self, k, v):
new_value = v<EOL>if isinstance(v, dict):<EOL><INDENT>new_value = type(self)(v)<EOL><DEDENT>elif isinstance(v, list):<EOL><INDENT>new_value = [(type(self)(e) if isinstance(e, dict) else e)<EOL>for e in v]<EOL><DEDENT>self.__dict__[k] = new_value<EOL>
Update the object with new data.