[New-bugs-announce] [issue23651] Typo in argparse allow_abrev

Nathan West report at bugs.python.org
Thu Mar 12 19:37:11 CET 2015

New submission from Nathan West:

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'])

assignee: docs at python
components: Documentation
messages: 237971
nosy: Lucretiel, docs at python
priority: normal
severity: normal
status: open
title: Typo in argparse allow_abrev
versions: Python 3.5

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list