Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5e0c5714
Commit
5e0c5714
authored
Mar 30, 2012
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#10423: clarify options vs args in argparse discussion of optparse
Patch by Sandro Tosi.
parent
6f5e54e7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
Doc/library/argparse.rst
Doc/library/argparse.rst
+3
-2
No files found.
Doc/library/argparse.rst
View file @
5e0c5714
...
@@ -1833,9 +1833,10 @@ A partial upgrade path from :mod:`optparse` to :mod:`argparse`:
...
@@ -1833,9 +1833,10 @@ A partial upgrade path from :mod:`optparse` to :mod:`argparse`:
* Replace all :meth:`optparse.OptionParser.add_option` calls with
* Replace all :meth:`optparse.OptionParser.add_option` calls with
:meth:`ArgumentParser.add_argument` calls.
: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`
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
* Replace callback actions and the ``callback_*`` keyword arguments with
``type`` or ``action`` arguments.
``type`` or ``action`` arguments.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment