mirror of
https://github.com/python/cpython.git
synced 2025-09-30 12:21:51 +00:00
#11904: fix indentation in argparse doc. Noticed by Vladimir Rutsky.
This commit is contained in:
parent
0a43ecc9df
commit
310619c80f
1 changed files with 4 additions and 4 deletions
|
@ -647,7 +647,7 @@ them, though most actions simply add an attribute to the object returned by
|
||||||
command-line args should be handled. The supported actions are:
|
command-line args should be handled. The supported actions are:
|
||||||
|
|
||||||
* ``'store'`` - This just stores the argument's value. This is the default
|
* ``'store'`` - This just stores the argument's value. This is the default
|
||||||
action. For example::
|
action. For example::
|
||||||
|
|
||||||
>>> parser = argparse.ArgumentParser()
|
>>> parser = argparse.ArgumentParser()
|
||||||
>>> parser.add_argument('--foo')
|
>>> parser.add_argument('--foo')
|
||||||
|
@ -655,9 +655,9 @@ command-line args should be handled. The supported actions are:
|
||||||
Namespace(foo='1')
|
Namespace(foo='1')
|
||||||
|
|
||||||
* ``'store_const'`` - This stores the value specified by the const_ keyword
|
* ``'store_const'`` - This stores the value specified by the const_ keyword
|
||||||
argument. (Note that the const_ keyword argument defaults to the rather
|
argument. (Note that the const_ keyword argument defaults to the rather
|
||||||
unhelpful ``None``.) The ``'store_const'`` action is most commonly used with
|
unhelpful ``None``.) The ``'store_const'`` action is most commonly used with
|
||||||
optional arguments that specify some sort of flag. For example::
|
optional arguments that specify some sort of flag. For example::
|
||||||
|
|
||||||
>>> parser = argparse.ArgumentParser()
|
>>> parser = argparse.ArgumentParser()
|
||||||
>>> parser.add_argument('--foo', action='store_const', const=42)
|
>>> parser.add_argument('--foo', action='store_const', const=42)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue