From 9d8b8aa502b6505b5538e206e0ddb5a9a7dd3e5d Mon Sep 17 00:00:00 2001 From: Jean-Louis GUENEGO Date: Thu, 5 Jun 2025 15:38:09 +0200 Subject: [PATCH 1/3] feat: apply pep8 by using docstring instead of comment in the doc. Giving the right example incitates the tutorial readers to do the same in the future. --- Doc/tutorial/modules.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/tutorial/modules.rst b/Doc/tutorial/modules.rst index de7aa0e2342946..32eef344d117fe 100644 --- a/Doc/tutorial/modules.rst +++ b/Doc/tutorial/modules.rst @@ -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: From d3251bd18a833150c6b97a9cebae3d5fd58eb211 Mon Sep 17 00:00:00 2001 From: Jean-Louis GUENEGO Date: Fri, 6 Jun 2025 14:37:24 +0200 Subject: [PATCH 2/3] Update Doc/tutorial/modules.rst Co-authored-by: Victor Stinner --- Doc/tutorial/modules.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/tutorial/modules.rst b/Doc/tutorial/modules.rst index 32eef344d117fe..2ff9804fcbb018 100644 --- a/Doc/tutorial/modules.rst +++ b/Doc/tutorial/modules.rst @@ -28,7 +28,7 @@ called :file:`fibo.py` in the current directory with the following contents:: # Fibonacci numbers module def fib(n): - """write Fibonacci series up to n""" + """Write Fibonacci series up to n.""" a, b = 0, 1 while a < n: print(a, end=' ') From 12c20fe249cc288f6c6371f0725c200b6474612b Mon Sep 17 00:00:00 2001 From: Jean-Louis GUENEGO Date: Fri, 6 Jun 2025 14:37:47 +0200 Subject: [PATCH 3/3] Update Doc/tutorial/modules.rst Co-authored-by: Victor Stinner --- Doc/tutorial/modules.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/tutorial/modules.rst b/Doc/tutorial/modules.rst index 2ff9804fcbb018..47bf7547b4ae1d 100644 --- a/Doc/tutorial/modules.rst +++ b/Doc/tutorial/modules.rst @@ -36,7 +36,7 @@ called :file:`fibo.py` in the current directory with the following contents:: print() def fib2(n): - """return Fibonacci series up to n""" + """Return Fibonacci series up to n.""" result = [] a, b = 0, 1 while a < n: