]> granicus.if.org Git - python/commitdiff
Convert a 0/1 to False/True.
authorRaymond Hettinger <python@rcn.com>
Tue, 2 Dec 2003 07:38:30 +0000 (07:38 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 2 Dec 2003 07:38:30 +0000 (07:38 +0000)
Doc/tut/tut.tex

index 56dd395587f36d4b2453c76d7b01ead8d9316823..1c9b0bcf4f02605cdfc41e2443e0b169292ad787 100644 (file)
@@ -1420,8 +1420,8 @@ arguments than it is defined
 def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):
     while True:
         ok = raw_input(prompt)
-        if ok in ('y', 'ye', 'yes'): return 1
-        if ok in ('n', 'no', 'nop', 'nope'): return 0
+        if ok in ('y', 'ye', 'yes'): return True
+        if ok in ('n', 'no', 'nop', 'nope'): return False
         retries = retries - 1
         if retries < 0: raise IOError, 'refusenik user'
         print complaint