New submission from elypter <[email protected]>:
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 <[email protected]>
<https://bugs.python.org/issue32552>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com