[Python-bugs-list] [ python-Bugs-659604 ] optparse store_true uses 1 and 0
noreply@sourceforge.net
noreply@sourceforge.net
Sat, 28 Dec 2002 23:37:14 -0800
Bugs item #659604, was opened at 2002-12-29 07:37
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=659604&group_id=5470
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Brian Lenihan (brianl)
Assigned to: Nobody/Anonymous (nobody)
Summary: optparse store_true uses 1 and 0
Initial Comment:
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":
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=659604&group_id=5470