From: Steven Bethard Date: Sat, 26 Mar 2011 20:50:38 +0000 (+0100) Subject: Issue #9343: Document that argparse parent parsers must be configured before their... X-Git-Tag: v2.7.2rc1~209 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e0062d25a38e5f01e10952827a83975afac9fd8;p=python Issue #9343: Document that argparse parent parsers must be configured before their children. (Merge from 3.2.) --- diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 459647b49c..b34be8af0a 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -347,6 +347,11 @@ Note that most parent parsers will specify ``add_help=False``. Otherwise, the :class:`ArgumentParser` will see two ``-h/--help`` options (one in the parent and one in the child) and raise an error. +.. note:: + You must fully initialize the parsers before passing them via ``parents=``. + If you change the parent parsers after the child parser, those changes will + not be reflected in the child. + formatter_class ^^^^^^^^^^^^^^^ diff --git a/Misc/NEWS b/Misc/NEWS index 3ed93da781..151bc1c487 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -239,6 +239,9 @@ Library - Issue #8982: Improve the documentation for the argparse Namespace object. +- Issue #9343: Document that argparse parent parsers must be configured before + their children. + Extension Modules -----------------