Skip to content

Commit 994621f

Browse files
Merge branch 'pybind:master' into master
2 parents 85b385d + c5ed9d4 commit 994621f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

include/pybind11/pybind11.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,7 @@ PYBIND11_NAMESPACE_BEGIN(detail)
13221322

13231323
template <>
13241324
struct handle_type_name<module_> {
1325-
static constexpr auto name = const_name("module");
1325+
static constexpr auto name = const_name("types.ModuleType");
13261326
};
13271327

13281328
PYBIND11_NAMESPACE_END(detail)

tests/test_modules.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ def test_pydoc():
8181
assert pydoc.text.docmodule(pybind11_tests)
8282

8383

84+
def test_module_handle_type_name():
85+
assert (
86+
m.def_submodule.__doc__
87+
== "def_submodule(arg0: types.ModuleType, arg1: str) -> types.ModuleType\n"
88+
)
89+
90+
8491
def test_duplicate_registration():
8592
"""Registering two things with the same name"""
8693

0 commit comments

Comments
 (0)