[issue43259] argparse: allow add_mutually_exclusive_group on add_argument_group

Christoph Anton Mitterer report at bugs.python.org
Sun Feb 21 18:52:23 EST 2021


Christoph Anton Mitterer <calestyo at scientia.org> added the comment:

Well but if that's anyway one of its actual major use cases, wouldn't it make sense to properly support it?

Especially when one has a large set of identical options (which is then even more likely to also include mutually exclusive ones) such a feature seems to be pretty useful to prevent bloated code by copy&pasting large number of lines of identical argument parsing code.


argparse is really nice and powerful,... and enables people to make clean argparsing code, but it seems a few quite features which are quite often asked for miss, like e.g. #11354 or that one can arbitrarily group mutually exclusive options like:

<mutually exclusive>
<group>
--foo
</group>
<group>
--bar
--baz
</group>
<(mutually exclusive>


Anyway, feel free to close if you don't like supporting mutually exclusive groups with parents.

Cheers,
Chris.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43259>
_______________________________________


More information about the Python-bugs-list mailing list