Issue 9343: Document that argparse "parents" must be fully declared before children (original) (raw)

Created on 2010-07-23 12:57 by bethard, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg111306 - (view) Author: Steven Bethard (bethard) * (Python committer) Date: 2010-07-23 12:57
[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
msg111307 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-07-23 13:02
I removed 3.3, since it currently means “won’t be done for 3.2, so note for later.” I don’t know if the report applies to 3.1 (doc fixes go into stable releases too), so I’m not adding it.
msg111308 - (view) Author: Steven Bethard (bethard) * (Python committer) Date: 2010-07-23 13:06
Ah, thanks for the fix. No it doesn't need to go in 3.1 - argparse is only in 2.7 and 3.2.
msg132272 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-03-26 20:52
New changeset d288666c1d58 by Steven Bethard in branch '3.2': Issue #9343: Document that argparse parent parsers must be configured before their children. http://hg.python.org/cpython/rev/d288666c1d58 New changeset 15e98607555d by Steven Bethard in branch '2.7': Issue #9343: Document that argparse parent parsers must be configured before their children. (Merge from 3.2.) http://hg.python.org/cpython/rev/15e98607555d New changeset 8bdc20468cbc by Steven Bethard in branch 'default': Issue #9343: Document that argparse parent parsers must be configured before their children. (Merge from 3.2.) http://hg.python.org/cpython/rev/8bdc20468cbc
msg132273 - (view) Author: Steven Bethard (bethard) * (Python committer) Date: 2011-03-26 20:53
I added some documentation in the "parents" section of the argparse docs.
History
Date User Action Args
2022-04-11 14:57:04 admin set github: 53589
2011-03-26 20:53:27 bethard set status: open -> closedmessages: + assignee: docs@python -> bethardresolution: fixedstage: resolved
2011-03-26 20:52:13 python-dev set nosy: + python-devmessages: +
2010-07-23 13:06:50 bethard set messages: +
2010-07-23 13:02:11 eric.araujo set nosy: + eric.araujomessages: + versions: - Python 3.3
2010-07-23 12:57:25 bethard create