Lines Matching full:foo*
54 py::class<Foo>(m, "Foo")
55 .def("__init__", [](Foo &self, ...) {
56 new (&self) Foo(...); // uses placement-new
60 py::class<Foo>(m, "Foo")
62 return new Foo(...); // return by raw pointer
63 // or: return std::make_unique<Foo>(...); // return by holder
64 // or: return Foo(...); // return by value (move constructor)
73 py::class<Foo>(m, "Foo")
75 .def("__getstate__", [](const Foo &self) {
78 .def("__setstate__", [](Foo &self, py::tuple t) {
79 new (&self) Foo(t[0].cast<std::string>(), ...);
83 py::class<Foo>(m, "Foo")
86 [](const Foo &self) { // __getstate__
90 return new Foo(t[0].cast<std::string>(), ...);
91 // or: return std::make_unique<Foo>(...); // return by holder
92 // or: return Foo(...); // return by value (move constructor)
102 pybind11-bound class 'mymodule.Foo' is using an old-style placement-new '__init__'
281 py::class_<Foo>(m, "Foo", py::metaclass())
282 .def_property_readonly_static("foo", ...);
285 py::class_<Foo>(m, "Foo")
286 .def_property_readonly_static("foo", ...);
401 | ``if (obj.attr("foo"))`` | ``if (py::hasattr(obj, "foo"))`` |