Skip to content

Commit 71b9527

Browse files
committed
Add docstring options to documentation
1 parent 384b6c1 commit 71b9527

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/advanced/misc.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,15 @@ The class ``options`` allows you to selectively suppress auto-generated signatur
324324
m.def("add", [](int a, int b) { return a + b; }, "A function which adds two numbers");
325325
}
326326
327+
pybind11 also appends all members of an enum to the resulting enum docstring,
328+
this default behaviour can be disabled by using the ``disable_enum_members_docstring()``
329+
function of the ``options`` classe.
330+
331+
With ``disable_user_defined_docstrings()`` all user defined docstrings of
332+
``module_::def()``, ``class_::def()`` and ``enum_()`` are discarded, but the
333+
function signatures and enum members are included in the docstring, unless they
334+
are disabled seperately.
335+
327336
Note that changes to the settings affect only function bindings created during the
328337
lifetime of the ``options`` instance. When it goes out of scope at the end of the module's init function,
329338
the default settings are restored to prevent unwanted side effects.

0 commit comments

Comments
 (0)