Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
griffe-inherited-docstrings
Advanced tools
Griffe extension for inheriting docstrings.
pip install griffe-inherited-docstrings
With Python:
import griffe
griffe.load("...", extensions=griffe.load_extensions(["griffe_inherited_docstrings"]))
With MkDocs and mkdocstrings:
plugins:
- mkdocstrings:
handlers:
python:
options:
extensions:
- griffe_inherited_docstrings
The extension will iterate on every class and their members to set docstrings from parent classes when they are not already defined.
The extension accepts a merge
option, that when set to true
will actually merge all parent docstrings in the class hierarchy
to the child docstring, if any.
plugins:
- mkdocstrings:
handlers:
python:
options:
extensions:
- griffe_inherited_docstrings:
merge: true
class A:
def method(self):
"""Method in A."""
class B(A):
def method(self):
...
class C(B):
...
class D(C):
def method(self):
"""Method in D."""
class E(D):
def method(self):
"""Method in E."""
With the code above, docstrings will be merged like following:
Class | Method docstring |
---|---|
A | Method in A. |
B | Method in A. |
C | Method in A. |
D | Method in A. Method in D. |
E | Method in A. Method in D. Method in E. |
WARNING: Limitation This extension runs once on whole packages. There is no way to toggle merging or simple inheritance for specifc objects.
FAQs
Griffe extension for inheriting docstrings.
We found that griffe-inherited-docstrings demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.