[issue9348] Calling argparse's add_argument with the wrong number of metavars causes delayed error message

daniel hahler report at bugs.python.org
Mon Jul 6 08:35:10 EDT 2020


daniel hahler <python-bugs at thequod.de> added the comment:

This adds overhead, since it creates a formatter and uses it for formatting only for validation purposes.

I think it is better to only have the error when the formatter is actually used (i.e. the help is displayed - which is not the typical use case, and it should be optimized for not displaying the help (i.e. only parsing args)).
The error could be more specific than before/initially though, of course.

----------
nosy: +blueyed

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


More information about the Python-bugs-list mailing list