[New-bugs-announce] [issue9343] Document that argparse "parents" must be fully declared before children

Steven Bethard report at bugs.python.org
Fri Jul 23 14:57:27 CEST 2010


New submission from Steven Bethard <steven.bethard at gmail.com>:

[From http://code.google.com/p/argparse/issues/detail?id=61]

It should be documented clearly that only the arguments present on the parent parser at the time ArgumentParser is called will be included in the parser.

>>> parent = argparse.ArgumentParser(add_help=False)
>>> child = argparse.ArgumentParser(parents=[parent])
>>> parent.add_argument('--foo', action='store_true')
>>> child.parse_args(['--foo'])
usage: [-h]
: error: unrecognized arguments: --foo

----------
assignee: docs at python
components: Documentation
messages: 111306
nosy: bethard, docs at python
priority: normal
severity: normal
status: open
title: Document that argparse "parents" must be fully declared before children
versions: Python 2.7, Python 3.2, Python 3.3

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


More information about the New-bugs-announce mailing list