cpython: 939631c6bc6f (original) (raw)

Mercurial > cpython

changeset 71603:939631c6bc6f 3.2

Add a link target for argparse.Namespace (#8982) [#8982]

Éric Araujo merwok@netwok.org
date Fri, 29 Jul 2011 17:59:17 +0200
parents 7bfc0a45542c
children e37fa30c4be4
files Doc/library/argparse.rst
diffstat 1 files changed, 10 insertions(+), 7 deletions(-)[+] [-] Doc/library/argparse.rst 17

line wrap: on

line diff

--- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -110,7 +110,7 @@ Parsing arguments :class:ArgumentParser parses args through the :meth:~ArgumentParser.parse_args method. This will inspect the command line, convert each arg to the appropriate type and then invoke the appropriate action. -In most cases, this means a simple namespace object will be built up from +In most cases, this means a simple :class:Namespace object will be built up from attributes parsed out of the command line:: >>> parser.parse_args(['--sum', '7', '-1', '42']) @@ -722,7 +722,7 @@ the Action API. The easiest way to do t

+This class is deliberately simple, just an :class:object subclass with a +readable string representation. If you prefer to have dict-like view of the +attributes, you can use the standard Python idiom, :func:vars:: >>> parser = argparse.ArgumentParser() >>> parser.add_argument('--foo')