Skip to content

Commit a879f03

Browse files
ShaharNavehTomAugspurger
authored andcommitted
DOC: Fix indentation in docstring example (pandas-dev#30833)
* DOC: Fix indent
1 parent da10947 commit a879f03

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

doc/source/development/contributing_docstring.rst

+33-33
Original file line numberDiff line numberDiff line change
@@ -22,39 +22,39 @@ Next example gives an idea on how a docstring looks like:
2222
.. code-block:: python
2323
2424
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
5858
5959
Some standards exist about docstrings, so they are easier to read, and they can
6060
be exported to other formats such as html or pdf.

0 commit comments

Comments
 (0)