Author paul.j3
Recipients Arfrever, barry, paul.j3, r.david.murray, ustinov
Date 2015-09-28.01:13:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1443402840.2.0.353991821351.issue19462@psf.upfronthosting.co.za>
In-reply-to
Content
I realized while answering a Stackoverflow question that the resolve method has the pieces for removing an Action from the parser.  It removes an existing Action so that the new, conflicting one, can replace it.

It's meant to be used with flagged arguments.  If `arg1` is an action with one option_string, it can be removed with:

    parser._handle_conflict_resolve(None, [('--arg1', arg1)])

If it is a positional, this call seems to be sufficient:

    arg1.container._remove_action(arg1)

http://stackoverflow.com/a/32809642/901925

Beyond answering this question I haven't tested the idea.  If there's more interest I could explore it more.
History
Date User Action Args
2015-09-28 01:14:00paul.j3setrecipients: + paul.j3, barry, Arfrever, r.david.murray, ustinov
2015-09-28 01:14:00paul.j3setmessageid: <1443402840.2.0.353991821351.issue19462@psf.upfronthosting.co.za>
2015-09-28 01:14:00paul.j3linkissue19462 messages
2015-09-28 01:13:59paul.j3create