diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-06-02 18:31:51 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-06-02 18:31:51 (GMT) |
commit | 9c27c18c658044268aaee8c857f20131b8ff3e06 (patch) | |
tree | 8cb33f1ebd34fb53cd4c8e1d617fe01ff531416e /Doc/tutorial | |
parent | 9cd39a170b4e65bd17ba853e87134000523c055a (diff) | |
parent | 0a5120e457107bc4288a60cf81b8fe0911958fc2 (diff) | |
download | cpython-9c27c18c658044268aaee8c857f20131b8ff3e06.zip cpython-9c27c18c658044268aaee8c857f20131b8ff3e06.tar.gz cpython-9c27c18c658044268aaee8c857f20131b8ff3e06.tar.bz2 |
Issue #23116: Merge from 3.5
Diffstat (limited to 'Doc/tutorial')
-rw-r--r-- | Doc/tutorial/controlflow.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index 9a13d08..b03b553 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -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: |