https://github.com/python/cpython/commit/d79acd96e083e6ac2b9b9c71fcff1161fc3bfa18
commit: d79acd96e083e6ac2b9b9c71fcff1161fc3bfa18
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: asvetlov <[email protected]>
date: 2024-11-14T10:46:26+01:00
summary:

[3.12] Document that return-less user-defined functions return None (GH-126769) 
(#126823)

Document that return-less user-defined functions return None (GH-126769)
(cherry picked from commit e0692f11650acb6c2eed940eb94650b4703c072e)

Co-authored-by: John Marshall <[email protected]>
Co-authored-by: Andrew Svetlov <[email protected]>
Co-authored-by: Carol Willing <[email protected]>

files:
M Doc/reference/expressions.rst

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::

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to