From b8f5cc0ae52841cfdffdd30284e75ff6a8ba2108 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Mon, 20 Sep 2021 13:53:12 -0400 Subject: [PATCH] Fix test case with __new__ --- tests/test_class.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_class.cpp b/tests/test_class.cpp index 0b998330d7..52a41a3bc0 100644 --- a/tests/test_class.cpp +++ b/tests/test_class.cpp @@ -63,8 +63,9 @@ TEST_SUBMODULE(class_, m) { .def_static("new_instance", &NoConstructor::new_instance, "Return an instance"); py::class_(m, "NoConstructorNew") - .def(py::init([](NoConstructorNew *self) { return self; })) // Need a NOOP __init__ - .def_static("__new__", [](const py::object *) { return NoConstructorNew::new_instance(); } ); + .def(py::init([](const NoConstructorNew &self) { return self; })) // Need a NOOP __init__ + .def_static("__new__", + [](const py::object &) { return NoConstructorNew::new_instance(); }); // test_inheritance class Pet {