@@ -88,7 +88,12 @@ facilitate reading the docstrings in text terminals.
88
88
89
89
Sections
90
90
--------
91
- The sections of the docstring are:
91
+
92
+ The docstring consists of a number of sections separated by headings (except
93
+ for the deprecation warning). Each heading should be underlined in hyphens, and
94
+ the section ordering should be consistent with the description below.
95
+
96
+ The sections of a function's docstring are:
92
97
93
98
1. **Short summary **
94
99
@@ -264,7 +269,16 @@ The sections of the docstring are:
264
269
This section should be used judiciously, i.e., only for errors
265
270
that are non-obvious or have a large chance of getting raised.
266
271
267
- 9. **See Also **
272
+ 9. **Warns **
273
+
274
+ An optional section detailing which warnings get raised and
275
+ under what conditions, formatted similarly to Raises.
276
+
277
+ 10. **Warnings **
278
+
279
+ An optional section with cautions to the user in free text/reST.
280
+
281
+ 11. **See Also **
268
282
269
283
An optional section used to refer to related code. This section
270
284
can be very useful, but should be used judiciously. The goal is to
@@ -303,7 +317,7 @@ The sections of the docstring are:
303
317
func_b, func_c_, func_d
304
318
func_e
305
319
306
- 10 . **Notes **
320
+ 12 . **Notes **
307
321
308
322
An optional section that provides additional information about the
309
323
code, possibly including a discussion of the algorithm. This
@@ -348,7 +362,7 @@ The sections of the docstring are:
348
362
where filename is a path relative to the reference guide source
349
363
directory.
350
364
351
- 11 . **References **
365
+ 13 . **References **
352
366
353
367
References cited in the **notes ** section may be listed here,
354
368
e.g. if you cited the article below using the text ``[1]_ ``,
@@ -373,7 +387,7 @@ The sections of the docstring are:
373
387
should not be required to understand it. References are numbered, starting
374
388
from one, in the order in which they are cited.
375
389
376
- 12 . **Examples **
390
+ 14 . **Examples **
377
391
378
392
An optional section for examples, using the `doctest
379
393
<http://docs.python.org/library/doctest.html> `_ format.
0 commit comments