Commit e21eabe
feat: Add docstring attribute to parameters
This change gives the Parameter class the `docstring` and `function` attributes.
The docstring value is only populated for dataclasses.
This makes it possible to access this information for all dataclass parameters,
especially those set as `InitVar` where it was not possible to get it
since they are not members (attributes) of the class.
This slot can also be used to support things like PEP 727 (with extensions).
In the future, we might add such a docstring slot to yielded, received and returned values too.
Issue-286: #286
Related-to-mkdocstrings/griffe#252: #252
PR-288: #288
Co-authored-by: Timothée Mazzucotelli <[email protected]>1 parent dd954ad commit e21eabe
File tree
4 files changed
+59
-2
lines changed- src/griffe
- extensions
- tests
4 files changed
+59
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
184 | 185 | | |
185 | 186 | | |
186 | 187 | | |
| 188 | + | |
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
| |||
193 | 195 | | |
194 | 196 | | |
195 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
196 | 204 | | |
197 | 205 | | |
198 | 206 | | |
| |||
218 | 226 | | |
219 | 227 | | |
220 | 228 | | |
221 | | - | |
| 229 | + | |
222 | 230 | | |
223 | 231 | | |
224 | 232 | | |
| |||
227 | 235 | | |
228 | 236 | | |
229 | 237 | | |
230 | | - | |
| 238 | + | |
231 | 239 | | |
232 | 240 | | |
233 | 241 | | |
234 | 242 | | |
235 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
236 | 247 | | |
237 | 248 | | |
238 | 249 | | |
| |||
1650 | 1661 | | |
1651 | 1662 | | |
1652 | 1663 | | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
1653 | 1667 | | |
1654 | 1668 | | |
1655 | 1669 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
0 commit comments