paul j3 added the comment:
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.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue19462>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com