Skip to content

Commit

Permalink
Merge branch 'pybind:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sun1638650145 authored Jan 2, 2025
2 parents 85b385d + c5ed9d4 commit 994621f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/pybind11/pybind11.h
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ PYBIND11_NAMESPACE_BEGIN(detail)

template <>
struct handle_type_name<module_> {
static constexpr auto name = const_name("module");
static constexpr auto name = const_name("types.ModuleType");
};

PYBIND11_NAMESPACE_END(detail)
Expand Down
7 changes: 7 additions & 0 deletions tests/test_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ def test_pydoc():
assert pydoc.text.docmodule(pybind11_tests)


def test_module_handle_type_name():
assert (
m.def_submodule.__doc__
== "def_submodule(arg0: types.ModuleType, arg1: str) -> types.ModuleType\n"
)


def test_duplicate_registration():
"""Registering two things with the same name"""

Expand Down

0 comments on commit 994621f

Please sign in to comment.