Skip to content

Commit bff6f61

Browse files
committed
docs: Improve docs for Docstring.source
Issue-371: #371
1 parent c1290e7 commit bff6f61

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/griffe/_internal/models.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ def lines(self) -> list[str]:
137137
def source(self) -> str:
138138
"""The original, uncleaned value of the docstring as written in the source.
139139
140+
It is a simple concatenation of the source lines. These source lines will include
141+
quotes (single/double/triple) and might include leading whitespace and indentation,
142+
as well as trailing comments.
143+
144+
Raises:
145+
ValueError: If the original docstring cannot be retrieved
146+
(no parent, no line numbers, or attached to namespace package).
147+
140148
See also: [`value`][griffe.Docstring.value].
141149
"""
142150
if self.parent is None:

0 commit comments

Comments
 (0)