]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
feat(docs): type fix - apply pep8 by using docstring instead of comment in the doc...
authorJean-Louis GUENEGO <jlguenego@gmail.com>
Fri, 6 Jun 2025 13:16:12 +0000 (15:16 +0200)
committerGitHub <noreply@github.com>
Fri, 6 Jun 2025 13:16:12 +0000 (15:16 +0200)
Giving the right example incitates the tutorial readers to do the same in the future.

Doc/tutorial/modules.rst

index de7aa0e2342946868936ff4b4eea4e02b9482acb..47bf7547b4ae1d3136c358c979cd265942fe46d1 100644 (file)
@@ -27,14 +27,16 @@ called :file:`fibo.py` in the current directory with the following contents::
 
    # Fibonacci numbers module
 
-   def fib(n):    # write Fibonacci series up to n
+   def fib(n):
+       """Write Fibonacci series up to n."""
        a, b = 0, 1
        while a < n:
            print(a, end=' ')
            a, b = b, a+b
        print()
 
-   def fib2(n):   # return Fibonacci series up to n
+   def fib2(n):
+       """Return Fibonacci series up to n."""
        result = []
        a, b = 0, 1
        while a < n: