Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9c27c18c
Commit
9c27c18c
authored
Jun 02, 2016
by
Berker Peksag
Browse files
Options
Browse Files
Download
Plain Diff
Issue #23116: Merge from 3.5
parents
9cd39a17
0a5120e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Doc/tutorial/controlflow.rst
Doc/tutorial/controlflow.rst
+3
-3
No files found.
Doc/tutorial/controlflow.rst
View file @
9c27c18c
...
...
@@ -364,7 +364,7 @@ The most useful form is to specify a default value for one or more arguments.
This creates a function that can be called with fewer arguments than it is
defined to allow. For example::
def ask_ok(prompt, retries=4,
complaint='Yes or no, please
!'):
def ask_ok(prompt, retries=4,
reminder='Please try again
!'):
while True:
ok = input(prompt)
if ok in ('y', 'ye', 'yes'):
...
...
@@ -373,8 +373,8 @@ defined to allow. For example::
return False
retries = retries - 1
if retries < 0:
raise
OSError('uncooperative user
')
print(
complaint
)
raise
ValueError('invalid user response
')
print(
reminder
)
This function can be called in several ways:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment