Issue 659604: optparse store_true uses 1 and 0 (original) (raw)
When using store_true and store_false actions, the optparse module sets the values to 1 and 0, rather than True and False.
--- optparse.py 14 Nov 2002 22:00:19 -0000 1.1 +++ optparse.py 29 Dec 2002 07:34:06 -0000 @@ -609,9 +609,9 @@ elif action == "store_const": setattr(values, dest, self.const) elif action == "store_true":
setattr(values, dest, 1)
setattr(values, dest, True) elif action == "store_false":
setattr(values, dest, 0)
setattr(values, dest, False) elif action == "append": values.ensure_value(dest, []).append(value) elif action == "count":
Logged In: YES user_id=14422
Problems with optparse.py should be addressed via Optik's project page, CVS archive, etc. I've fixed Optik to use True/False when available; that fix made it into Optik1.4.1. I'll be checking in a revised optparse.py based on Optik 1.4.1 real soon now (as soon as it passes its test suite).