[Python-checkins] cpython (2.7): Issue #9343: Document that argparse parent parsers must be configured before

steven.bethard python-checkins at python.org
Sat Mar 26 21:52:12 CET 2011


http://hg.python.org/cpython/rev/15e98607555d
changeset:   68987:15e98607555d
branch:      2.7
parent:      68979:fe72160ea2a3
user:        Steven Bethard <steven.bethard at gmail.com>
date:        Sat Mar 26 21:50:38 2011 +0100
summary:
  Issue #9343: Document that argparse parent parsers must be configured before their children. (Merge from 3.2.)

files:
  Doc/library/argparse.rst |  5 +++++
  Misc/NEWS                |  3 +++
  2 files changed, 8 insertions(+), 0 deletions(-)


diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -347,6 +347,11 @@
 :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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -239,6 +239,9 @@
 
 - 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
 -----------------
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list