We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a32c69 commit 8c47ebfCopy full SHA for 8c47ebf
Doc/library/argparse.rst
@@ -2123,7 +2123,10 @@ Parser defaults
2123
>>> parser.parse_args(['736'])
2124
Namespace(bar=42, baz='badger', foo=736)
2125
2126
- Note that parser-level defaults always override argument-level defaults::
+ Note that defaults can be set at both the parser level using :meth:`set_defaults`
2127
+ and at the argument level using :meth:`add_argument`. If both are provided for the
2128
+ same attribute, the order of setting these defaults determines which one takes
2129
+ precedence. The last default set for an attribute is the one that is used:
2130
2131
>>> parser = argparse.ArgumentParser()
2132
>>> parser.add_argument('--foo', default='bar')
0 commit comments