homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: s/args/options in arpgarse "Upgrading optparse code"
Type: Stage: resolved
Components: Documentation Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: bethard, docs@python, python-dev, sandro.tosi, tshepang
Priority: normal Keywords: patch

Created on 2010年11月15日 10:30 by bethard, last changed 2022年04月11日 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue10423.patch sandro.tosi, 2011年02月11日 18:42
Messages (7)
msg121219 - (view) Author: Steven Bethard (bethard) * (Python committer) Date: 2010年11月15日 10:30
From a personal email:
----------------------------------------------------------------------
I'm not signed up for all the Python issue tracking stuff, but thought I'd let you know about a problem with the argparse doc page:
 http://docs.python.org/library/argparse.html
It says at the end:
 Replace options, args = parser.parse_args() with args = parser.parse_args() and add additional ArgumentParser.add_argument() calls for the positional arguments.
But I think it should be options = parser.parse_args(), not args.
----------------------------------------------------------------------
They're not options, so I don't like encouraging people to continue to call them options, but the docs should at least make clear that the namespace object that used to be called "options" is now called "args".
msg128347 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2011年02月10日 22:21
Hi Steven, I'm not exactly getting what you're meaning here: are you actually saying to replace every occurrence of 'option' with 'argument' in the whole argparse module doc, or just make it stronger in the mentioned line that what was called previously 'option' is now called 'args' ?
PS: wouldn't it be better to use this form "(options, args) = parser.parse_args()" instead of "options, args = parser.parse_args()" ? optparse doc uses the former, so it should be easy to recognize for those willing to migrate to argparse
msg128372 - (view) Author: Steven Bethard (bethard) * (Python committer) Date: 2011年02月11日 10:52
The request was for the latter: "just make it stronger in the mentioned line that what was called previously 'option' is now called 'args'".
As far as adding the parentheses or not, I never once used the parentheses back when I was using optparse, so it didn't even strike me to put them in there. But you're right - the optparse docs do that, so I'm fine if you'd like to make the argparse discussion of optparse match up better with the optparse docs.
msg128418 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2011年02月11日 18:41
I've prepared a simple patch: what do you think about it?
msg128419 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2011年02月11日 18:42
now even with patch attached :)
msg128426 - (view) Author: Steven Bethard (bethard) * (Python committer) Date: 2011年02月11日 20:01
Looks good to me. This is a doc fix, so it could go into 3.2 and 2.7 as well as 3.3.
msg157153 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012年03月30日 22:09
New changeset dee1597b3ce3 by R David Murray in branch '3.2':
#10423: clarify options vs args in argparse discussion of optparse
http://hg.python.org/cpython/rev/dee1597b3ce3
New changeset 7ad1728691b2 by R David Murray in branch 'default':
Merge #10423: clarify options vs args in argparse discussion of optparse
http://hg.python.org/cpython/rev/7ad1728691b2
New changeset cb5214e6c287 by R David Murray in branch '2.7':
#10423: clarify options vs args in argparse discussion of optparse
http://hg.python.org/cpython/rev/cb5214e6c287 
History
Date User Action Args
2022年04月11日 14:57:08adminsetgithub: 54632
2012年03月30日 22:10:13r.david.murraysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2012年03月30日 22:09:40python-devsetnosy: + python-dev
messages: + msg157153
2012年03月18日 21:31:42tshepangsetnosy: + tshepang
2011年02月11日 20:01:23bethardsetnosy: bethard, sandro.tosi, docs@python
messages: + msg128426
versions: + Python 2.7, Python 3.2
2011年02月11日 18:42:17sandro.tosisetfiles: + issue10423.patch

messages: + msg128419
keywords: + patch
nosy: bethard, sandro.tosi, docs@python
2011年02月11日 18:41:55sandro.tosisetnosy: bethard, sandro.tosi, docs@python
messages: + msg128418
stage: needs patch -> patch review
2011年02月11日 10:52:09bethardsetnosy: bethard, sandro.tosi, docs@python
messages: + msg128372
2011年02月10日 22:21:49sandro.tosisetnosy: + sandro.tosi

messages: + msg128347
versions: + Python 3.3, - Python 3.2
2010年11月15日 10:30:33bethardcreate

AltStyle によって変換されたページ (->オリジナル) /