Skip to content

optparse store_true uses 1 and 0 #37658

Closed

Description

@brianl
mannequin
BPO 659604

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2003-04-21.02:42:59.000>
created_at = <Date 2002-12-29.07:37:14.000>
labels = ['library']
title = 'optparse store_true uses 1 and 0'
updated_at = <Date 2003-04-21.02:42:59.000>
user = 'https://bugs.python.org/brianl'

bugs.python.org fields:

activity = <Date 2003-04-21.02:42:59.000>
actor = 'gward'
assignee = 'gward'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2002-12-29.07:37:14.000>
creator = 'brianl'
dependencies = []
files = []
hgrepos = []
issue_num = 659604
keywords = []
message_count = 4.0
messages = ['13698', '13699', '13700', '13701']
nosy_count = 3.0
nosy_names = ['nnorwitz', 'gward', 'brianl']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue659604'
versions = ['Python 2.3']

Activity

  1. brianl commented on Dec 29, 2002

    brianlmannequin
    MannequinAuthor

    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":
  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Dec 29, 2002
  3. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Dec 29, 2002
  4. nnorwitz commented on Dec 29, 2002

    nnorwitzmannequin
    Mannequin

    Logged In: YES
    user_id=33168

    Greg, any problem with making this change? Assign to me, if
    you want me to do it.

  5. gward commented on Apr 21, 2003

    gwardmannequin
    Mannequin

    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).

  6. gward commented on Apr 21, 2003

    gwardmannequin
    Mannequin

    Logged In: YES
    user_id=14422

    OK, fixed in rev 1.3 of optparse.py.

  7. transferred this issue fromon Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directory

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions