[issue32552] Improve text for file arguments in argparse.ArgumentDefaultsHelpFormatter class
elypter
report at bugs.python.org
Sun Jan 14 19:35:36 EST 2018
New submission from elypter <elypter at yahoo.de>:
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:
-suffixes [SUFFIXES]
suffixes file which contains keywords that are often
the last part of a class or style name of a sticky bar
(default: <open file 'sources/suffixes.txt', mode 'r'
at 0xb71385f8>)
it should rather look like
-suffixes [SUFFIXES]
suffixes file which contains keywords that are often
the last part of a class or style name of a sticky bar
(default:'sources/suffixes.txt')
the same holds probably true for more exotic datatypes. so an alternative or an addition could be to add an option to arguments to not add the default to the help text
----------
components: Library (Lib)
messages: 309940
nosy: elypter
priority: normal
severity: normal
status: open
title: Improve text for file arguments in argparse.ArgumentDefaultsHelpFormatter class
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32552>
_______________________________________
More information about the Python-bugs-list
mailing list