diff --git a/field.py b/field.py index 7d616ae73ebd20ebf59d39fd6fe67f854e6a9f60..4d10df7afecc1364855720b7b3e5b8d2371f9609 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 816194a91f64dd64e030037f4ff4fba382900e67..72ad8fe6942551c3c24dcdeb5fa6a1bba72f868b 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 +