]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] Document that return-less user-defined functions return None (GH-126769) ...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 14 Nov 2024 09:46:26 +0000 (10:46 +0100)
committerGitHub <noreply@github.com>
Thu, 14 Nov 2024 09:46:26 +0000 (10:46 +0100)
Document that return-less user-defined functions return None (GH-126769)
(cherry picked from commit e0692f11650acb6c2eed940eb94650b4703c072e)

Co-authored-by: John Marshall <jmarshall@hey.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Doc/reference/expressions.rst

index 829200efa34c35a1b7807a08901c9d0c5676a538..6c178ad87608299bab8e16bb936a68adffa9f6c3 100644 (file)
@@ -1149,7 +1149,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::