{"id":23625,"library":"docstring-inheritance","title":"docstring-inheritance","description":"Avoid writing and maintaining duplicated docstrings by automatically inheriting and merging docstrings from parent classes. Current version 3.0.0, requires Python >=3.10 <4.0. Active development with infrequent releases.","status":"active","version":"3.0.0","language":"python","source_language":"en","source_url":"https://github.com/AntoineD/docstring-inheritance","tags":["docstring","inheritance","decorator","documentation"],"install":[{"cmd":"pip install docstring-inheritance","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"wrong":"from docstring_inheritance import inherit_docstrings","symbol":"inherit_google_docstring","correct":"from docstring_inheritance import inherit_google_docstring"},{"wrong":"from docstring_inheritance import inherit_docstrings","symbol":"inherit_numpy_docstring","correct":"from docstring_inheritance import inherit_numpy_docstring"},{"wrong":"from docstring_inheritance import inherit_docstrings","symbol":"GoogleDocstringInheritanceMeta","correct":"from docstring_inheritance import GoogleDocstringInheritanceMeta"}],"quickstart":{"code":"from docstring_inheritance import inherit_docstrings\n\nclass Base:\n    def method(self, x: int, y: str) -> bool:\n        \"\"\"Do something.\n\n        Parameters\n        ----------\n        x : int\n            First parameter.\n        y : str\n            Second parameter.\n\n        Returns\n        -------\n        bool\n            Result.\n        \"\"\"\n        return True\n\n@inherit_docstrings\nclass Child(Base):\n    def method(self, x: int, y: str) -> bool:\n        # Only the extra information is added here; docstring is inherited.\n        return True\n\nprint(Child.method.__doc__)","lang":"python","description":"Apply the @inherit_docstrings decorator to a class to inherit docstrings from parent classes. Child class methods will automatically merge the parent's docstring with any new content."},"warnings":[{"fix":"Apply @inherit_docstrings to each class that should inherit docstrings. Or set a global flag if supported (check docs).","message":"In version 3.0.0, the default behavior changed to not inherit docstrings automatically unless the @inherit_docstrings decorator is explicitly applied. Previously, in version 2.x, docstring inheritance happened automatically for all subclasses. Update your code to add the decorator.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use 'from docstring_inheritance import inherit_docstrings' instead.","message":"The 'inherit_docstring' (singular) function was deprecated in favor of 'inherit_docstrings' (plural) in version 2.x and removed in 3.0.0.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Apply @inherit_docstrings to the class definition, not to individual methods.","message":"The decorator only works on classes, not on individual methods. If you apply it to a method, it will be silently ignored or raise an error.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"search_vec":"'3.0.0':21 '3.10':24 '4.0':25 'activ':26 'automat':11 'avoid':4 'class':18 'current':19 'decor':33 'develop':27 'docstr':2,9,15,31 'docstring-inherit':1 'document':34 'duplic':8 'infrequ':29 'inherit':3,12,32 'maintain':7 'merg':14 'parent':17 'python':23 'releas':30 'requir':22 'version':20 'write':5","created_at":"2026-05-01T08:08:45.368763+00:00","updated_at":"2026-05-01T08:08:45.368763+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"3.0.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/AntoineD/docstring-inheritance","docs":"https://antoined.github.io/docstring-inheritance","changelog":null,"pypi":"https://pypi.org/project/docstring-inheritance/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}