[issue32552] Improve text for file arguments in argparse.ArgumentDefaultsHelpFormatter class

2018-09-30 Thread paul j3
paul j3 added the comment: https://bugs.python.org/issue28742 argparse.ArgumentDefaultsHelpFormatter sometimes provides inaccurate documentation of defaults, so they should be overrideable is asking for something similar - the ability to override the automatic `%(default)s` in certain

[issue32552] Improve text for file arguments in argparse.ArgumentDefaultsHelpFormatter class

2018-09-27 Thread paul j3
paul j3 added the comment: An alternative to customizing a HelpFormatter is to write your own utility `add_argument` function, e.g. def my_add_argument(parser, *args, add_default=True, **kwargs): if add_default: help = kwargs.get('help','') help += ' (default:

[issue32552] Improve text for file arguments in argparse.ArgumentDefaultsHelpFormatter class

2018-04-24 Thread paul j3
paul j3 added the comment: This subclass makes are one method change: from: def _get_help_string(self, action): return action.help to: def _get_help_string(self, action): help = action.help if '%(default)' not in action.help:

[issue32552] Improve text for file arguments in argparse.ArgumentDefaultsHelpFormatter class

2018-01-14 Thread elypter
New submission from elypter : If you use formatter_class=argparse.ArgumentDefaultsHelpFormatter in the constructor then the defaults that you include in arguments get automatically added to the help text. this looks great for int and Strings but not for files. example: