[issue10423] s/args/options in arpgarse "Upgrading optparse code"
New submission from Steven Bethard <steven.bethard@gmail.com>:
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". ---------- assignee: docs@python components: Documentation messages: 121219 nosy: bethard, docs@python priority: normal severity: normal stage: needs patch status: open title: s/args/options in arpgarse "Upgrading optparse code" versions: Python 3.2 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10423> _______________________________________
Sandro Tosi <sandro.tosi@gmail.com> added the comment: 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 ---------- nosy: +sandro.tosi versions: +Python 3.3 -Python 3.2 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10423> _______________________________________
Steven Bethard <steven.bethard@gmail.com> added the comment: 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. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10423> _______________________________________
Sandro Tosi <sandro.tosi@gmail.com> added the comment: I've prepared a simple patch: what do you think about it? ---------- stage: needs patch -> patch review _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10423> _______________________________________
Sandro Tosi <sandro.tosi@gmail.com> added the comment: now even with patch attached :) ---------- keywords: +patch Added file: http://bugs.python.org/file20747/issue10423.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10423> _______________________________________
Steven Bethard <steven.bethard@gmail.com> added the comment: Looks good to me. This is a doc fix, so it could go into 3.2 and 2.7 as well as 3.3. ---------- versions: +Python 2.7, Python 3.2 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10423> _______________________________________
Changes by Tshepang Lekhonkhobe <tshepang@gmail.com>: ---------- nosy: +tshepang _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10423> _______________________________________
Roundup Robot <devnull@psf.upfronthosting.co.za> added the comment: 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 ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10423> _______________________________________
Changes by R. David Murray <rdmurray@bitdance.com>: ---------- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10423> _______________________________________
participants (5)
-
R. David Murray -
Roundup Robot -
Sandro Tosi -
Steven Bethard -
Tshepang Lekhonkhobe