From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 14 Nov 2024 09:46:58 +0000 (+0100) Subject: [3.13] Document that return-less user-defined functions return None (GH-126769) ... X-Git-Tag: v3.13.1~109 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4fd628837c13636b91392a33dd32a80a086d3fa4;p=thirdparty%2FPython%2Fcpython.git [3.13] Document that return-less user-defined functions return None (GH-126769) (#126822) Document that return-less user-defined functions return None (GH-126769) (cherry picked from commit e0692f11650acb6c2eed940eb94650b4703c072e) Co-authored-by: John Marshall Co-authored-by: Andrew Svetlov Co-authored-by: Carol Willing --- diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index decde0d297cf..3eaceae41f7e 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -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::