From 5c73e3c6192941ca6ebe340f4df74d83e34f8a3f Mon Sep 17 00:00:00 2001 From: Masaki Kozuki Date: Tue, 28 Jun 2022 11:19:34 -0700 Subject: [PATCH 1/2] Fix binding of `Pet::Attributes` --- docs/classes.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/classes.rst b/docs/classes.rst index 0c687b7c53..ad200212aa 100644 --- a/docs/classes.rst +++ b/docs/classes.rst @@ -482,7 +482,8 @@ The binding code for this example looks as follows: .value("Cat", Pet::Kind::Cat) .export_values(); - py::class_ attributes(pet, "Attributes") + py::class_ attributes(pet, "Attributes"); + attributes .def(py::init<>()) .def_readwrite("age", &Pet::Attributes::age); From ba1c2619a5ca06dec9ca8c865602ffcb5c8cfe6f Mon Sep 17 00:00:00 2001 From: Masaki Kozuki Date: Tue, 28 Jun 2022 11:59:06 -0700 Subject: [PATCH 2/2] omit `attributes` as it's not needed Signed-off-by: Masaki Kozuki --- docs/classes.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/classes.rst b/docs/classes.rst index ad200212aa..c0c53135b8 100644 --- a/docs/classes.rst +++ b/docs/classes.rst @@ -482,8 +482,7 @@ The binding code for this example looks as follows: .value("Cat", Pet::Kind::Cat) .export_values(); - py::class_ attributes(pet, "Attributes"); - attributes + py::class_(pet, "Attributes") .def(py::init<>()) .def_readwrite("age", &Pet::Attributes::age);