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 1f9516a commit cfec1b0Copy full SHA for cfec1b0
1 file changed
Doc/library/argparse.rst
@@ -1052,9 +1052,9 @@ is used when no command-line argument was present::
1052
>>> parser.parse_args([])
1053
Namespace(foo=42)
1054
1055
-Because ``nargs='*'`` collects matched values into a list, an absent positional
1056
-argument yields an empty list (``[]``); a default of ``None`` is replaced by
1057
-``[]``, although any other default is used as given.
+Because ``nargs='*'`` gathers any supplied values into a list, an absent
+positional argument yields an empty list (``[]``). Only a non-``None``
+*default* overrides this (so ``default=None`` still gives ``[]``).
1058
1059
For required_ arguments, the ``default`` value is ignored. For example, this
1060
applies to positional arguments with nargs_ values other than ``?`` or ``*``,
0 commit comments