From f1d105b77d4377a4f9f15581bb581d6bbf225f40 Mon Sep 17 00:00:00 2001 From: Hao Gao Date: Sat, 1 Sep 2018 11:07:55 -0500 Subject: [PATCH] Call constructor inside __setstate__ --- sumpy/kernel.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sumpy/kernel.py b/sumpy/kernel.py index 12255a93..768ad1a3 100644 --- a/sumpy/kernel.py +++ b/sumpy/kernel.py @@ -149,8 +149,7 @@ class Kernel(object): def __setstate__(self, state): # Can't use trivial pickling: hash_value cache must stay unset assert len(self.init_arg_names) == len(state) - for name, value in zip(self.init_arg_names, state): - setattr(self, name, value) + self.__init__(*state) # }}} -- GitLab