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

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


http://hg.python.org/cpython/rev/dee1597b3ce3
changeset:   75999:dee1597b3ce3
branch:      3.2
parent:      75988:cd8347e15f62
user:        R David Murray <rdmurray at bitdance.com>
date:        Fri Mar 30 18:07:42 2012 -0400
summary:
  #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
@@ -1833,9 +1833,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