From 23463e301ae25afb671f325f3ffe27be921f8e1b Mon Sep 17 00:00:00 2001 From: Stephan Seitz <xu29mapu@stud.informatik.uni-erlangen.de> Date: Fri, 29 Nov 2019 11:09:11 +0100 Subject: [PATCH] Add __getnewargs__ to TypedImaginaryUnit There was a problem when pickling TypedImaginaryUnit since it was using the __getnewargs__ of TypedSymbol. --- pystencils/data_types.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pystencils/data_types.py b/pystencils/data_types.py index 4899bff2d..af085ab3c 100644 --- a/pystencils/data_types.py +++ b/pystencils/data_types.py @@ -827,3 +827,6 @@ class TypedImaginaryUnit(TypedSymbol): __xnew__ = staticmethod(__new_stage2__) __xnew_cached_ = staticmethod(cacheit(__new_stage2__)) + + def __getnewargs__(self): + return (self.dtype,) -- GitLab