Thanks to visit codestin.com Credit goes to github.com
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 f0ab07f commit 95f6e12Copy full SHA for 95f6e12
1 file changed
Doc/library/argparse.rst
@@ -2070,7 +2070,9 @@ Parser defaults
2070
>>> parser.parse_args(['736'])
2071
Namespace(bar=42, baz='badger', foo=736)
2072
2073
- 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`
2074
+ and at the argument level using :meth:`add_argument`. If both are called for the
2075
+ same argument, the last default set for an argument is used::
2076
2077
>>> parser = argparse.ArgumentParser()
2078
>>> parser.add_argument('--foo', default='bar')
0 commit comments