summaryrefslogtreecommitdiffstats
path: root/Doc/library/argparse.rst
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2012-03-30 22:07:42 (GMT)
committerR David Murray <rdmurray@bitdance.com>2012-03-30 22:07:42 (GMT)
commit5e0c57142d7380d7209f198f772bb9851739652d (patch)
tree6930eb4d21f1c30c6eefaa628cfec17d3ac96548 /Doc/library/argparse.rst
parent6f5e54e76915d9a8767f7241f0e835116877e6e5 (diff)
downloadcpython-5e0c57142d7380d7209f198f772bb9851739652d.zip
cpython-5e0c57142d7380d7209f198f772bb9851739652d.tar.gz
cpython-5e0c57142d7380d7209f198f772bb9851739652d.tar.bz2
#10423: clarify options vs args in argparse discussion of optparse
Patch by Sandro Tosi.
Diffstat (limited to 'Doc/library/argparse.rst')
-rw-r--r--Doc/library/argparse.rst5
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index b84e5c8..0123b5c 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -1833,9 +1833,10 @@ A partial upgrade path from :mod:`optparse` to :mod:`argparse`:
* 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.