classification
Title: Typo in argparse allow_abrev
Type: Stage: resolved
Components: Documentation Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Lucretiel, berker.peksag, docs@python, python-dev
Priority: normal Keywords:

Created on 2015-03-12 18:37 by Lucretiel, last changed 2015-03-12 18:47 by berker.peksag. This issue is now closed.

Messages (3)
msg237971 - (view) Author: Nathan West (Lucretiel) * Date: 2015-03-12 18:37
The documentation for the new argparse feature allow_abrev contains a typo:

>>> parser.add_argument('--foobar', action='store_true')
>>> parser.add_argument('--foonley', action='store_false')
>>> parser.parse_args([--foon])
usage: PROG [-h] [--foobar] [--foonley]
PROG: error: unrecognized arguments: --foon

The --foon should be quoted:

>>> parser.parse_args(['--foon'])
msg237974 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-03-12 18:46
New changeset 8411ae359c98 by Berker Peksag in branch 'default':
Issue #23651: Fix typo in allow_abbrev docs.
https://hg.python.org/cpython/rev/8411ae359c98
msg237975 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-03-12 18:47
Good catch, Nathan. Thanks!
History
Date User Action Args
2015-03-12 18:47:09berker.peksagsetstatus: open -> closed

nosy: + berker.peksag
messages: + msg237975

resolution: fixed
stage: resolved
2015-03-12 18:46:42python-devsetnosy: + python-dev
messages: + msg237974
2015-03-12 18:37:11Lucretielcreate