]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Document that return-less user-defined functions return None (#126769)
authorJohn Marshall <jmarshall@hey.com>
Thu, 14 Nov 2024 07:47:24 +0000 (20:47 +1300)
committerGitHub <noreply@github.com>
Thu, 14 Nov 2024 07:47:24 +0000 (07:47 +0000)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Doc/reference/expressions.rst

index decde0d297cf59b11d4a89d0e0404f89321ca8cb..3eaceae41f7eaf157bc45294b50eb698469b7010 100644 (file)
@@ -1156,7 +1156,8 @@ a user-defined function:
    first thing the code block will do is bind the formal parameters to the
    arguments; this is described in section :ref:`function`.  When the code block
    executes a :keyword:`return` statement, this specifies the return value of the
-   function call.
+   function call.  If execution reaches the end of the code block without
+   executing a :keyword:`return` statement, the return value is ``None``.
 
 a built-in function or method:
    .. index::