Skip to content

Commit

Permalink
bugfix: fixes a test suite bug in the __new__ example (#4698)
Browse files Browse the repository at this point in the history
* bugfix: fixes a test suite bug in the __new__ example

* See #4698 (comment)

---------

Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
  • Loading branch information
Skylion007 and rwgk committed Jul 12, 2023
1 parent 2e5f5c4 commit b33d06f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ TEST_SUBMODULE(class_, m) {
.def_static("new_instance", &NoConstructor::new_instance, "Return an instance");

py::class_<NoConstructorNew>(m, "NoConstructorNew")
.def(py::init([](const NoConstructorNew &self) { return self; })) // Need a NOOP __init__
.def(py::init([]() { return nullptr; })) // Need a NOOP __init__
.def_static("__new__",
[](const py::object &) { return NoConstructorNew::new_instance(); });

Expand Down

0 comments on commit b33d06f

Please sign in to comment.