Commit 6e6975e2 by Aaron Gokaslan Committed by GitHub

Fix test case with __new__ (#3285)

parent d0f3c51f
...@@ -63,8 +63,9 @@ TEST_SUBMODULE(class_, m) { ...@@ -63,8 +63,9 @@ TEST_SUBMODULE(class_, m) {
.def_static("new_instance", &NoConstructor::new_instance, "Return an instance"); .def_static("new_instance", &NoConstructor::new_instance, "Return an instance");
py::class_<NoConstructorNew>(m, "NoConstructorNew") py::class_<NoConstructorNew>(m, "NoConstructorNew")
.def(py::init([](NoConstructorNew *self) { return self; })) // Need a NOOP __init__ .def(py::init([](const NoConstructorNew &self) { return self; })) // Need a NOOP __init__
.def_static("__new__", [](const py::object *) { return NoConstructorNew::new_instance(); } ); .def_static("__new__",
[](const py::object &) { return NoConstructorNew::new_instance(); });
// test_inheritance // test_inheritance
class Pet { class Pet {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment