mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-16 13:47:53 +00:00
Set module name for defined functions
This commit is contained in:
parent
de3ad07899
commit
2a1ce23a3f
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user