[issue45580] argparse.ArgumentParser.add_mutually_exclusive_group : metavar create parenthesis undefined behavior

paul j3 report at bugs.python.org
Mon Oct 25 12:32:34 EDT 2021


paul j3 <ajipanca at gmail.com> added the comment:

The usage formatting is fragile, with many associated bug reports.  Until someone does a major rewrite, it is best to avoid special characters, especially `()` and `[]` in the `dest` or `metavar`.

Usage uses () to encolde mutually_exclusive_groups and [] to mark non-required arguments.  Don't confuse your users (or argparse) with other uses of these characters.

----------
nosy: +paul.j3

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


More information about the Python-bugs-list mailing list