From 8940c4feae25af55c699221405338ea8b2df615e Mon Sep 17 00:00:00 2001 From: Martin Bauer <martin.bauer@fau.de> Date: Mon, 21 Nov 2016 16:54:56 +0100 Subject: [PATCH] deepcopy and pickle support for TypedSymbol and Field.Access --- field.py | 3 +++ typedsymbol.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/field.py b/field.py index 7d616ae73..4d10df7af 100644 --- a/field.py +++ b/field.py @@ -226,6 +226,9 @@ class Field: return obj + def __getnewargs__(self): + return self.name, self.offsets, self.index + __xnew__ = staticmethod(__new_stage2__) __xnew_cached_ = staticmethod(cacheit(__new_stage2__)) diff --git a/typedsymbol.py b/typedsymbol.py index 816194a91..72ad8fe69 100644 --- a/typedsymbol.py +++ b/typedsymbol.py @@ -24,3 +24,7 @@ class TypedSymbol(sp.Symbol): superClassContents = list(super(TypedSymbol, self)._hashable_content()) t = tuple(superClassContents + [hash(self._dtype)]) return t + + def __getnewargs__(self): + return self.name, self.dtype + -- GitLab