File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed
py-demo/bindings/src/modules Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change 11#pragma once
22#include < string>
33
4- namespace demo {
4+ namespace demo
5+ {
6+ // note: class stubs must not be sorted
7+ // https://github.com/sizmailov/pybind11-stubgen/issues/231
58
6- struct Base {
7- struct Inner {};
8- std::string name;
9- };
10-
11- struct Derived : Base {
12- int count;
13- };
9+ struct MyBase {
10+ struct Inner {};
11+ std::string name;
12+ };
1413
14+ struct Derived : MyBase {
15+ int count;
16+ };
1517}
Original file line number Diff line number Diff line change @@ -19,13 +19,13 @@ void bind_classes_module(py::module&&m) {
1919 }
2020
2121 {
22- py::class_<demo::Base> pyBase (m, " Base " );
22+ py::class_<demo::MyBase> pyMyBase (m, " MyBase " );
2323
24- pyBase .def_readwrite (" name" , &demo::Base ::name);
24+ pyMyBase .def_readwrite (" name" , &demo::MyBase ::name);
2525
26- py::class_<demo::Base ::Inner>(pyBase , " Inner" );
26+ py::class_<demo::MyBase ::Inner>(pyMyBase , " Inner" );
2727
28- py::class_<demo::Derived, demo::Base >(m, " Derived" )
28+ py::class_<demo::Derived, demo::MyBase >(m, " Derived" )
2929 .def_readwrite (" count" , &demo::Derived::count);
3030
3131 }
You can’t perform that action at this time.
0 commit comments