diff --git a/src/docstring_inheritance/docstring_inheritors/bases/inheritor.py b/src/docstring_inheritance/docstring_inheritors/bases/inheritor.py index 484165a..2512fa6 100644 --- a/src/docstring_inheritance/docstring_inheritors/bases/inheritor.py +++ b/src/docstring_inheritance/docstring_inheritors/bases/inheritor.py @@ -40,7 +40,7 @@ class BaseDocstringInheritor: MISSING_ARG_DESCRIPTION: ClassVar[str] = "The description is missing." """The fall back description for a method argument without a description.""" - INHERIT_SECTION_TAG: ClassVar[str] = "__inherit_section_doc__" + INHERIT_SECTION_PLACEHOLDER: ClassVar[str] = "__inherit_doc__" """Placeholder used to indicate that a section docstring shall be inherited.""" _MISSING_ARG_TEXT: ClassVar[str] @@ -92,7 +92,7 @@ def _filters_inherited_sections( for key, item in tuple(sections.items()): if isinstance(item, dict): cls._filters_inherited_sections(cast(SectionsType, item)) - elif item.strip().startswith(cls.INHERIT_SECTION_TAG): + elif item.strip().startswith(cls.INHERIT_SECTION_PLACEHOLDER): del sections[key] @classmethod diff --git a/src/docstring_inheritance/docstring_inheritors/numpy.py b/src/docstring_inheritance/docstring_inheritors/numpy.py index f30ff21..1778ad6 100644 --- a/src/docstring_inheritance/docstring_inheritors/numpy.py +++ b/src/docstring_inheritance/docstring_inheritors/numpy.py @@ -73,8 +73,6 @@ def _parse_one_section( class NumpyDocstringInheritor(BaseDocstringInheritor): - _MISSING_ARG_TEXT: ClassVar[ - str - ] = f"\n {BaseDocstringInheritor.MISSING_ARG_DESCRIPTION}" + _MISSING_ARG_TEXT = f"\n {BaseDocstringInheritor.MISSING_ARG_DESCRIPTION}" _DOCSTRING_PARSER = DocstringParser _DOCSTRING_RENDERER = DocstringRenderer diff --git a/tests/test_base_inheritor.py b/tests/test_base_inheritor.py index e54b03e..fbd8790 100644 --- a/tests/test_base_inheritor.py +++ b/tests/test_base_inheritor.py @@ -307,10 +307,10 @@ def test_inherit_section_items_with_args(func, section_items, expected): ({}, {}), ({"": ""}, {"": ""}), ({"": {"": ""}}, {"": {"": ""}}), - ({"": "__inherit_section_doc__"}, {}), - ({"": "__inherit_section_doc__", "a": ""}, {"a": ""}), - ({"": {"": "__inherit_section_doc__"}}, {"": {}}), - ({"": {"": "__inherit_section_doc__", "a": ""}}, {"": {"a": ""}}), + ({"": "__inherit_doc__"}, {}), + ({"": "__inherit_doc__", "a": ""}, {"a": ""}), + ({"": {"": "__inherit_doc__"}}, {"": {}}), + ({"": {"": "__inherit_doc__", "a": ""}}, {"": {"a": ""}}), ), ) def test_filter_inherited_sections(sections, expected):