projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6914aa
)
Fix indentation in example.
author
Georg Brandl
<georg@python.org>
Mon, 26 Jul 2010 17:00:20 +0000
(17:00 +0000)
committer
Georg Brandl
<georg@python.org>
Mon, 26 Jul 2010 17:00:20 +0000
(17:00 +0000)
Doc/library/argparse.rst
patch
|
blob
|
history
diff --git
a/Doc/library/argparse.rst
b/Doc/library/argparse.rst
index 141385f4c57e3606c8320aae1f950ae4141a0e03..ec212d5044d0a5a3c23ed4b731484dbc53f6a90c 100644
(file)
--- a/
Doc/library/argparse.rst
+++ b/
Doc/library/argparse.rst
@@
-698,8
+698,8
@@
An example of a custom action::
>>> class FooAction(argparse.Action):
... def __call__(self, parser, namespace, values, option_string=None):
- ... print('%r %r %r' % (namespace, values, option_string))
- ... setattr(namespace, self.dest, values)
+ ...
print('%r %r %r' % (namespace, values, option_string))
+ ...
setattr(namespace, self.dest, values)
...
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('--foo', action=FooAction)