Skip to content

Commit ae3eab2

Browse files
committed
Get function signature right since the beginning
1 parent 02119ab commit ae3eab2

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

doc/tutorial/automatic-doc-generation.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ To use autodoc, first add it to the list of enabled extensions:
2828
]
2929
3030
Next, move the content of the ``.. py:function`` directive to the function
31-
docstring in the original Python file and add an optional ``kind`` argument,
32-
as follows:
31+
docstring in the original Python file, as follows:
3332

3433
.. code-block:: python
3534
:caption: lumache.py

doc/tutorial/describing-code.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ function ``get_random_ingredients`` like this:
178178
.. code-block:: python
179179
:caption: lumache.py
180180
181-
def get_random_ingredients():
181+
def get_random_ingredients(kind=None):
182182
return ["eggs", "bacon", "spam"]
183183
184184
You can now run ``make doctest`` to execute the doctests of your documentation.
@@ -214,7 +214,7 @@ for easy examination. It is now time to fix the function:
214214
:caption: lumache.py
215215
:emphasize-lines: 2
216216
217-
def get_random_ingredients():
217+
def get_random_ingredients(kind=None):
218218
return ["shells", "gorgonzola", "parsley"]
219219
220220
And finally, ``make test`` reports success!

0 commit comments

Comments
 (0)