diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index bd0eb509..f5a483f9 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;