Skip to content

Commit

Permalink
feat: Allow checking if docstring section is empty or not with `if se…
Browse files Browse the repository at this point in the history
…ction`
  • Loading branch information
pawamoy committed Aug 20, 2023
1 parent 929e615 commit f6cf559
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/griffe/docstrings/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ def __init__(self, title: str | None = None) -> None:
self.title: str | None = title
self.value: Any = None

def __bool__(self) -> bool:
return bool(self.value)

def as_dict(self, **kwargs: Any) -> dict[str, Any]:
"""Return this section's data as a dictionary.
Expand Down

0 comments on commit f6cf559

Please sign in to comment.