From 2a1ce23a3f175451b6f45e43d441028fa105264b Mon Sep 17 00:00:00 2001 From: Sylvain Corlay Date: Thu, 4 Feb 2016 15:21:09 -0500 Subject: [PATCH] Set module name for defined functions --- include/pybind11/pybind11.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index b6de43116..c4f9426d1 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -470,6 +470,7 @@ public: sibling((handle) attr(name_)), extra...); /* PyModule_AddObject steals a reference to 'func' */ PyModule_AddObject(ptr(), name_, func.inc_ref().ptr()); + func.attr("__module__") = attr("__name__"); return *this; }