diff --git a/docs/_extend_docstrings.py b/docs/_extend_docstrings.py index 21072976c..c1527b070 100644 --- a/docs/_extend_docstrings.py +++ b/docs/_extend_docstrings.py @@ -720,8 +720,10 @@ def _create_latex_doit_definition(expr: sp.Expr, deep: bool = False) -> str: def _append_to_docstring(class_type: Callable | type, appended_text: str) -> None: - assert class_type.__doc__ is not None - class_type.__doc__ += appended_text + if class_type.__doc__ is None: + class_type.__doc__ = appended_text + else: + class_type.__doc__ += appended_text def __generate_transitions_cached(