From 37f8a091ab198294c80ade7ce9dfa6be21b873ac Mon Sep 17 00:00:00 2001 From: John Marshall Date: Thu, 14 Nov 2024 20:47:24 +1300 Subject: [PATCH] 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 --- Doc/reference/expressions.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 829200efa34c35..6c178ad8760829 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -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::