Browse Source

attr_dict class is now pickable

Dimitri Korsch 6 years ago
parent
commit
f360639a48
1 changed files with 5 additions and 0 deletions
  1. 5 0
      nabirds/utils/__init__.py

+ 5 - 0
nabirds/utils/__init__.py

@@ -47,6 +47,11 @@ class attr_dict(dict):
 			return attr_dict(res)
 		return res
 
+	def __getstate__(self): return self.__dict__
+
+	def __setstate__(self, d): self.__dict__.update(d)
+
+
 class _MetaInfo(object):
 	def __init__(self, **kwargs):
 		for name, value in kwargs.items():