[Python-checkins] cpython (merge 3.2 -> default): Merge #10423: clarify options vs args in argparse discussion of optparse

r.david.murray python-checkins at python.org
Sat Mar 31 00:09:40 CEST 2012


http://hg.python.org/cpython/rev/7ad1728691b2
changeset:   76000:7ad1728691b2
parent:      75998:123cf2192c79
parent:      75999:dee1597b3ce3
user:        R David Murray <rdmurray at bitdance.com>
date:        Fri Mar 30 18:08:29 2012 -0400
summary:
  Merge #10423: clarify options vs args in argparse discussion of optparse

Patch by Sandro Tosi.

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


diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -1852,9 +1852,10 @@
 * Replace all :meth:`optparse.OptionParser.add_option` calls with
   :meth:`ArgumentParser.add_argument` calls.
 
-* Replace ``options, args = parser.parse_args()`` with ``args =
+* Replace ``(options, args) = parser.parse_args()`` with ``args =
   parser.parse_args()`` and add additional :meth:`ArgumentParser.add_argument`
-  calls for the positional arguments.
+  calls for the positional arguments. Keep in mind that what was previously
+  called ``options``, now in :mod:`argparse` context is called ``args``.
 
 * Replace callback actions and the ``callback_*`` keyword arguments with
   ``type`` or ``action`` arguments.

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


More information about the Python-checkins mailing list