From d186f99d00a8f2443774c9d277c9b615aa8b6d6d Mon Sep 17 00:00:00 2001 From: Steven Bethard Date: Sat, 26 Mar 2011 21:49:00 +0100 Subject: [PATCH] Issue #9343: Document that argparse parent parsers must be configured before their children. --- Doc/library/argparse.rst | 5 +++++ Misc/NEWS | 3 +++ 2 files changed, 8 insertions(+) diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 102b3e93025..2164ec004e5 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -351,6 +351,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 4638fd77917..babee78ead2 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -162,6 +162,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. + Build -----