[issue30127] argparse action not correctly describing the right behavior

2017-04-21 Thread Diego Costantini

Diego Costantini added the comment:

You are right, I misunderstood the part where it sets defaults opposite to the 
stored value, although apparently over one year ago I did understand it 
correctly when I first went through that documentation.

Today my second pair of eyes had my same understanding of it though :)

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<http://bugs.python.org/issue30127>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30127] argparse action not correctly describing the right behavior

2017-04-21 Thread Diego Costantini

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@python
components: Documentation
messages: 292044
nosy: Diego Costantini, docs@python
priority: normal
severity: normal
status: open
title: argparse action not correctly describing the right behavior
type: behavior
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue30127>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com