Skip to content

Commit 03b7f0a

Browse files
jmarshallasvetlovwillingc
authored andcommitted
Document that return-less user-defined functions return None (python#126769)
Co-authored-by: Andrew Svetlov <[email protected]> Co-authored-by: Carol Willing <[email protected]>
1 parent ebe0964 commit 03b7f0a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/reference/expressions.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,8 @@ a user-defined function:
11561156
first thing the code block will do is bind the formal parameters to the
11571157
arguments; this is described in section :ref:`function`. When the code block
11581158
executes a :keyword:`return` statement, this specifies the return value of the
1159-
function call.
1159+
function call. If execution reaches the end of the code block without
1160+
executing a :keyword:`return` statement, the return value is ``None``.
11601161

11611162
a built-in function or method:
11621163
.. index::

0 commit comments

Comments
 (0)