[New-bugs-announce] [issue30127] argparse action not correctly describing the right behavior

Diego Costantini report at bugs.python.org
Fri Apr 21 09:20:52 EDT 2017


New submission from Diego Costantini:

Here https://docs.python.org/2/library/argparse.html#action we have the following:

>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('--foo', action='store_true')
>>> parser.add_argument('--bar', action='store_false')
>>> parser.add_argument('--baz', action='store_false')
>>> parser.parse_args('--foo --bar'.split())
Namespace(bar=False, baz=True, foo=True)

baz should be False because omitted.
I also tested it.

----------
assignee: docs at python
components: Documentation
messages: 292044
nosy: Diego Costantini, docs at python
priority: normal
severity: normal
status: open
title: argparse action not correctly describing the right behavior
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30127>
_______________________________________


More information about the New-bugs-announce mailing list