From 6e6975e2171cd5fa5efc109a708dc81addae1880 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Mon, 20 Sep 2021 16:03:21 -0400 Subject: [PATCH] Fix test case with __new__ (#3285) --- 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 0b998330d..52a41a3bc 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 {