File tree 1 file changed +33
-33
lines changed
1 file changed +33
-33
lines changed Original file line number Diff line number Diff line change @@ -22,39 +22,39 @@ Next example gives an idea on how a docstring looks like:
22
22
.. code-block :: python
23
23
24
24
def add (num1 , num2 ):
25
- """
26
- Add up two integer numbers.
27
-
28
- This function simply wraps the `+` operator, and does not
29
- do anything interesting, except for illustrating what is
30
- the docstring of a very simple function.
31
-
32
- Parameters
33
- ----------
34
- num1 : int
35
- First number to add
36
- num2 : int
37
- Second number to add
38
-
39
- Returns
40
- -------
41
- int
42
- The sum of `num1` and `num2`
43
-
44
- See Also
45
- --------
46
- subtract : Subtract one integer from another
47
-
48
- Examples
49
- --------
50
- >>> add(2, 2)
51
- 4
52
- >>> add(25, 0)
53
- 25
54
- >>> add(10, -10)
55
- 0
56
- """
57
- return num1 + num2
25
+ """
26
+ Add up two integer numbers.
27
+
28
+ This function simply wraps the `+` operator, and does not
29
+ do anything interesting, except for illustrating what is
30
+ the docstring of a very simple function.
31
+
32
+ Parameters
33
+ ----------
34
+ num1 : int
35
+ First number to add
36
+ num2 : int
37
+ Second number to add
38
+
39
+ Returns
40
+ -------
41
+ int
42
+ The sum of `num1` and `num2`
43
+
44
+ See Also
45
+ --------
46
+ subtract : Subtract one integer from another
47
+
48
+ Examples
49
+ --------
50
+ >>> add(2, 2)
51
+ 4
52
+ >>> add(25, 0)
53
+ 25
54
+ >>> add(10, -10)
55
+ 0
56
+ """
57
+ return num1 + num2
58
58
59
59
Some standards exist about docstrings, so they are easier to read, and they can
60
60
be exported to other formats such as html or pdf.
You can’t perform that action at this time.
0 commit comments