refactor: module -> module_ with typedef (#2544)

* WIP: module -> module_ without typedef

* refactor: allow py::module to work again
This commit is contained in:
Henry Schreiner
2020-10-03 13:38:03 -04:00
committed by GitHub
parent 560ed3e34f
commit 6bcd220c8d
40 changed files with 132 additions and 127 deletions

View File

@@ -107,7 +107,7 @@ TEST_SUBMODULE(kwargs_and_defaults, m) {
return py::make_tuple(i, j, k, kwargs); },
py::arg() /* positional */, py::arg("j") = -1 /* both */, py::kw_only(), py::arg("k") /* kw-only */);
m.def("register_invalid_kw_only", [](py::module m) {
m.def("register_invalid_kw_only", [](py::module_ m) {
m.def("bad_kw_only", [](int i, int j) { return py::make_tuple(i, j); },
py::kw_only(), py::arg() /* invalid unnamed argument */, "j"_a);
});
@@ -138,5 +138,5 @@ TEST_SUBMODULE(kwargs_and_defaults, m) {
// Make sure a class (not an instance) can be used as a default argument.
// The return value doesn't matter, only that the module is importable.
m.def("class_default_argument", [](py::object a) { return py::repr(a); },
"a"_a = py::module::import("decimal").attr("Decimal"));
"a"_a = py::module_::import("decimal").attr("Decimal"));
}