gh-87209: Clarify ordering rule for default arguments in tutorial#138529
gh-87209: Clarify ordering rule for default arguments in tutorial#138529jeff14994 wants to merge 1 commit intopython:mainfrom
Conversation
ede58ce to
52a3ae5
Compare
Doc/tutorial/controlflow.rst
Outdated
| @@ -588,8 +588,9 @@ Default Argument Values | |||
| ----------------------- | |||
|
|
|||
| The most useful form is to specify a default value for one or more arguments. | |||
There was a problem hiding this comment.
| The most useful form is to specify a default value for one or more arguments. | |
| The most useful form is to specify a default value for one or more parameters. |
This is talking about parameters, not arguments.
Doc/tutorial/controlflow.rst
Outdated
| All arguments without default values must come first, followed by those with | ||
| defaults. This allows a function to be called with fewer arguments than it is | ||
| defined to allow. For example:: |
There was a problem hiding this comment.
| All arguments without default values must come first, followed by those with | |
| defaults. This allows a function to be called with fewer arguments than it is | |
| defined to allow. For example:: | |
| All positional only parameters (that is, without default values) must come first, followed by those with | |
| defaults. This allows a function to be called with fewer arguments than it is | |
| defined to allow. For example:: |
I think we should be introducing the proper terminology?
There was a problem hiding this comment.
Thanks, good point. I'll update this section to use parameters consistently since that's the proper terminology in this context. Appreciate the clarification!
52a3ae5 to
a323351
Compare
|
Hi @StanFromIreland, I’ve updated the body to use parameters consistently. Let me know if you spot anything else. Thanks! |
Doc/tutorial/controlflow.rst
Outdated
| The most useful form is to specify a default value for one or more parameters. | ||
| All positional only parameters (that is, without default values) must come first, followed by those with | ||
| defaults. This allows a function to be called with fewer arguments than it is | ||
| defined to allow. For example:: |
There was a problem hiding this comment.
Please ensure all lines are wrapped to 79 characters.
a323351 to
0c595ce
Compare
|
Hi @StanFromIreland, I’ve updated the section so that all lines are wrapped at 79 characters as requested. Please let me know if there’s anything else I should adjust. Thanks! |
|
Hi @StanFromIreland , Following up on this PR. Could you review when you have a chance?😃 |
|
Hi @StanFromIreland, Please let me know if I need to make any changes. |
This PR updates section 4.9.1 of the tutorial to clarify that arguments without default values must come before arguments with default values.
Current text:
Proposed text:
Closes gh-87209.
📚 Documentation preview 📚: https://cpython-previews--138529.org.readthedocs.build/