Skip to content

Commit f284c07

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

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Doc/tutorial/controlflow.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,10 @@ There are three forms, which can be combined.
587587
Default Argument Values
588588
-----------------------
589589

590-
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::
590+
The most useful form is to specify a default value for one or more arguments.
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)