Skip to content

Commit 52a3ae5

Browse files
committed
Doc: clarify ordering rule for default arguments in tutorial
1 parent 849a80e commit 52a3ae5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Doc/tutorial/controlflow.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,9 @@ Default Argument Values
588588
-----------------------
589589

590590
The most useful form is to specify a default value for one or more arguments.
591-
This creates a function that can be called with fewer arguments than it is
592-
defined to allow. For example::
591+
All arguments without default values must come first, followed by those with
592+
defaults. This allows a function to be called with fewer arguments than it is
593+
defined to allow. For example::
593594

594595
def ask_ok(prompt, retries=4, reminder='Please try again!'):
595596
while True:

0 commit comments

Comments
 (0)