Skip to content

Commit f6cf559

Browse files
committed
feat: Allow checking if docstring section is empty or not with if section
1 parent 929e615 commit f6cf559

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/griffe/docstrings/dataclasses.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ def __init__(self, title: str | None = None) -> None:
212212
self.title: str | None = title
213213
self.value: Any = None
214214

215+
def __bool__(self) -> bool:
216+
return bool(self.value)
217+
215218
def as_dict(self, **kwargs: Any) -> dict[str, Any]:
216219
"""Return this section's data as a dictionary.
217220

0 commit comments

Comments
 (0)