Skip to content

Commit 0c595ce

Browse files
committed
Doc: clarify ordering rule for default parameters in tutorial
1 parent 849a80e commit 0c595ce

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 parameters.
591+
All positional only parameters (that is, without default values) must come
592+
first, followed by those with defaults. This allows a function to be called
593+
with fewer arguments than it is 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)