[issue8982] argparse docs cross reference Namespace as a class but the Namespace class is not documented
New submission from R. David Murray <rdmurray@bitdance.com>: I wanted to find out if Namespace supported lookup by subscripting (args['someopt']), but the docs are silent on what Namespace is. (The answer, by the way, appears to be "no"; there is a feature request for this in issue 8979). ---------- assignee: bethard components: Documentation messages: 107653 nosy: bethard, docs@python, r.david.murray priority: normal severity: normal stage: needs patch status: open title: argparse docs cross reference Namespace as a class but the Namespace class is not documented type: behavior versions: Python 3.2 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue8982> _______________________________________
Steven Bethard <steven.bethard@gmail.com> added the comment: That's right, it doesn't support subscripting. The docs are silent on what namespace is mainly because I don't want to commit to anything other than an object with attributes. But that could be made clearer in the docs. ---------- versions: +Python 2.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue8982> _______________________________________
Changes by Éric Araujo <merwok@netwok.org>: ---------- nosy: +eric.araujo versions: +Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue8982> _______________________________________
Roundup Robot <devnull@devnull> added the comment: New changeset 423b50086b67 by Steven Bethard in branch '3.2': Issue #8982: Improve the documentation for the argparse Namespace object. http://hg.python.org/cpython/rev/423b50086b67 New changeset d832756a82d9 by Steven Bethard in branch 'default': Issue #8982: Improve the documentation for the argparse Namespace object. (Merge from 3.2.) http://hg.python.org/cpython/rev/d832756a82d9 New changeset fe72160ea2a3 by Steven Bethard in branch '2.7': Issue #8982: Improve the documentation for the argparse Namespace object. (Merge from 3.2.) http://hg.python.org/cpython/rev/fe72160ea2a3 ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue8982> _______________________________________
Steven Bethard <steven.bethard@gmail.com> added the comment: I fixed the docs here so that they're clearer about what the Namespace object is, and also so that they mention the `vars` approach if you want dict-style access. ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue8982> _______________________________________
Éric Araujo <merwok@netwok.org> added the comment: Attached patch adds a link target for :class:`Namespace` (already used in the docs) and adds a reference to it from for the first mentions of “namespace object”. Use “hg import blah.diff” (after “hg up 3.2”) to get the patch in the repo directly (with checkin message and my committer name) or usual patch(1) if you want to make amendments. ---------- keywords: +patch Added file: http://bugs.python.org/file21723/fix-argparse-class-directive.diff _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue8982> _______________________________________
Changes by Éric Araujo <merwok@netwok.org>: Removed file: http://bugs.python.org/file21723/fix-argparse-class-directive.diff _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue8982> _______________________________________
Éric Araujo <merwok@netwok.org> added the comment: Patch refreshed. If I get no negative feedback, I’ll commit it next week. ---------- Added file: http://bugs.python.org/file22320/fix-argparse-class-directive.diff _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue8982> _______________________________________
Roundup Robot <devnull@psf.upfronthosting.co.za> added the comment: New changeset 939631c6bc6f by Éric Araujo in branch '3.2': Add a link target for argparse.Namespace (#8982) http://hg.python.org/cpython/rev/939631c6bc6f ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue8982> _______________________________________
Roundup Robot <devnull@psf.upfronthosting.co.za> added the comment: New changeset 01722022f88d by Éric Araujo in branch '2.7': Add a link target for argparse.Namespace (#8982) http://hg.python.org/cpython/rev/01722022f88d ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue8982> _______________________________________
participants (4)
-
R. David Murray
-
Roundup Robot
-
Steven Bethard
-
Éric Araujo