From faf4e76a29950de889b119b33f2bdbe7a308af15 Mon Sep 17 00:00:00 2001 From: Jean-Louis GUENEGO Date: Fri, 6 Jun 2025 15:16:12 +0200 Subject: [PATCH] feat(docs): type fix - apply pep8 by using docstring instead of comment in the doc. (GH-135181) Giving the right example incitates the tutorial readers to do the same in the future. (cherry picked from commit 343182853f19a42c0ba8980d3104076a8c7bcfe7) Co-authored-by: Jean-Louis GUENEGO --- 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..47bf7547b4ae1d 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: