Merge branch 'master' into smart_holder

This commit is contained in:
Ralf W. Grosse-Kunstleve 2021-09-20 19:05:52 -07:00
commit a5ec28ffe8
2 changed files with 4 additions and 3 deletions

View File

@ -43,7 +43,7 @@ repos:
# Black, the code formatter, natively supports pre-commit
- repo: https://github.com/psf/black
rev: 21.8b0
rev: 21.9b0
hooks:
- id: black
# By default, this ignores pyi files, though black supports them

View File

@ -82,8 +82,9 @@ TEST_SUBMODULE(class_, m) {
.def_static("new_instance", &NoConstructor::new_instance, "Return an instance");
py::class_<NoConstructorNew>(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 {