@@ -64,11 +64,11 @@ def read_parameters_section(
64
64
Parse a "parameters" section.
65
65
66
66
Arguments:
67
- lines : The parameters block lines .
68
- start_index: The line number to start at .
67
+ docstring : The raw docstring .
68
+ docstring_obj: Docstring object parsed by docstring_parser .
69
69
70
70
Returns:
71
- A tuple containing a `Section` (or `None`) and the index at which to continue parsing .
71
+ A `Section` object (or `None` if section is empty) .
72
72
"""
73
73
parameters = []
74
74
@@ -114,10 +114,11 @@ def read_attributes_section(
114
114
Parse an "attributes" section.
115
115
116
116
Arguments:
117
+ docstring: The raw docstring.
117
118
docstring_obj: Docstring object parsed by docstring_parser.
118
119
119
120
Returns:
120
- A tuple containing a `Section` (or `None`).
121
+ A `Section` object (or `None` if section is empty ).
121
122
"""
122
123
attributes = []
123
124
docstring_attributes = [p for p in docstring_obj .params if p .args [0 ] == "attribute" ]
@@ -146,10 +147,11 @@ def read_exceptions_section(
146
147
Parse an "exceptions" section.
147
148
148
149
Arguments:
150
+ docstring: The raw docstring.
149
151
docstring_obj: Docstring object parsed by docstring_parser.
150
152
151
153
Returns:
152
- A tuple containing a `Section` (or `None`) and the index at which to continue parsing .
154
+ A `Section` object (or `None` if section is empty) .
153
155
"""
154
156
exceptions = []
155
157
except_obj = docstring_obj .raises
@@ -174,7 +176,7 @@ def read_return_section(
174
176
docstring_obj: Docstring object parsed by docstring_parser.
175
177
176
178
Returns:
177
- A tuple containing a `Section` (or `None`).
179
+ A `Section` object (or `None` if section is empty ).
178
180
"""
179
181
return_obj = docstring_obj .returns if docstring_obj .returns else []
180
182
text = return_obj .description if return_obj else ""
@@ -206,10 +208,11 @@ def read_examples_section(
206
208
Parse an "examples" section.
207
209
208
210
Arguments:
211
+ docstring: The raw docstring.
209
212
docstring_obj: Docstring object parsed by docstring_parser.
210
213
211
214
Returns:
212
- A tuple containing a `Section` (or `None`).
215
+ A `Section` object (or `None` if section is empty ).
213
216
"""
214
217
text = next (
215
218
(
0 commit comments