[Python-Dev] Issue 15906; regression in argparse in Python 3.3, 3.2, and 2.7

Barry Warsaw barry at python.org
Tue Sep 11 21:35:54 CEST 2012


On Sep 11, 2012, at 12:19 PM, R. David Murray wrote:

>There is another possible semantic, which is that when the store type is
>append, the converter should be applied to each of the individual items in
>the default list.

Yep.  Maybe for 3.4 <wink>.

>Which brings us to another issue: as things stand now, if we have, say,
>'default=['abc']', then passing in '--test x' on the command line would
>result in args.test being equal to
>
>    ['abc', 'x']
>
>which is consistent with optparse but not necessarily the desired
>semantics.

Right.  This gets to Chris's observation that we're blurring the meaning of
'default'.  For action='append' should that be the default value when no
arguments are given, or the starting value for the append operations?

We might need to add a 'start' argument when action='append'.

Cheers,
-Barry


More information about the Python-Dev mailing list