summaryrefslogtreecommitdiff
path: root/warlock/model.py
diff options
context:
space:
mode:
Diffstat (limited to 'warlock/model.py')
-rw-r--r--warlock/model.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/warlock/model.py b/warlock/model.py
index e026bbb..666128c 100644
--- a/warlock/model.py
+++ b/warlock/model.py
@@ -25,6 +25,7 @@ from . import exceptions
class Model(dict):
+
def __init__(self, *args, **kwargs):
# we overload setattr so set this manually
d = dict(*args, **kwargs)
@@ -91,6 +92,12 @@ class Model(dict):
def copy(self):
return copy.deepcopy(dict(self))
+ def __copy__(self):
+ return self.copy()
+
+ def __deepcopy__(self, memo):
+ return copy.deepcopy(dict(self), memo)
+
def update(self, other):
mutation = dict(self.items())
mutation.update(other)