<section id="properties">
<h2><a href="#properties">Properties</a></h2>
<dl class="m-doc">
+ <dt>
+ <a href="#bar" class="m-doc-self" id="bar">bar</a>: float <span class="m-label m-flat m-warning">get</span>
+ </dt>
+ <dd>A read-only property</dd>
<dt>
<a href="#foo" class="m-doc-self" id="foo">foo</a>: float <span class="m-label m-flat m-success">get set</span>
</dt>
.def("instance_function", &MyClass::instanceFunction, "Instance method with positional-only args")
.def("instance_function_kwargs", &MyClass::instanceFunction, "Instance method with position or keyword args", py::arg("hey"), py::arg("what") = "<eh?>")
.def("another", &MyClass::another, "Instance method with no args, 'self' is thus position-only")
- .def_property("foo", &MyClass::foo, &MyClass::setFoo, "A read/write property");
+ .def_property("foo", &MyClass::foo, &MyClass::setFoo, "A read/write property")
+ .def_property_readonly("bar", &MyClass::foo, "A read-only property");
py::class_<MyClass23> pybind23{m, "MyClass23", "Testing pybind 2.3 features"};