This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author the.mulhern
Recipients the.mulhern
Date 2015-02-02.14:23:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1422886990.52.0.318776752581.issue23378@psf.upfronthosting.co.za>
In-reply-to
Content
As well as the append action it would be convenient for there to be an extend action.

This is kind of useful to allow something like:

parser.add_argument("--foo", action="extend", nargs="+", type=str)

given

parser.parse_args("--foo f1 --foo f2 f3 f4".split())

to result in

["f1", "f2", "f3", "f4"].

The action "append" results in

[["f1"], ["f2", "f3", "f4"]]

And action store in

["f2", "f3", "f4"].

It is easy to write a custom action, but it feels like a fairly common requirement.

Probably it would make sense to extend the default, similarly to how append behaves.
History
Date User Action Args
2015-02-02 14:23:10the.mulhernsetrecipients: + the.mulhern
2015-02-02 14:23:10the.mulhernsetmessageid: <1422886990.52.0.318776752581.issue23378@psf.upfronthosting.co.za>
2015-02-02 14:23:10the.mulhernlinkissue23378 messages
2015-02-02 14:23:10the.mulherncreate