mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 06:35:12 +00:00
Fix test case with __new__ (#3285)
This commit is contained in:
parent
d0f3c51f01
commit
6e6975e217
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user