From a380ed9259489885701a66e7d4784296bd7ddc50 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sun, 15 May 2016 23:54:13 +0200 Subject: [PATCH] consider __setstate__ as a constructor --- include/pybind11/pybind11.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index bd0eb5090..f5a483f97 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -209,7 +209,7 @@ protected: rec->signature = strdup(signature.c_str()); rec->args.shrink_to_fit(); - rec->is_constructor = !strcmp(rec->name, "__init__"); + rec->is_constructor = !strcmp(rec->name, "__init__") || !strcmp(rec->name, "__setstate__"); rec->has_args = false; rec->has_kwargs = false; rec->nargs = args;