[issue13023] argparse should allow displaying argument default values in addition to setting a formatter class
Changes by Mark Lawrence breamore...@yahoo.co.uk: -- nosy: +paul.j3 versions: +Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13023 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13023] argparse should allow displaying argument default values in addition to setting a formatter class
Steven Bethard steven.beth...@gmail.com added the comment: Your solution is actually the current recommended solution - mix together both classes that you want to combine and pass your subclass as the parameter. This should probably be documented somewhere (and tested more). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13023 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13023] argparse should allow displaying argument default values in addition to setting a formatter class
Denilson Figueiredo de Sá denilso...@gmail.com added the comment: adding a formatter instance seems overkill for the usual case of wanting to preserve formatting of the epilog. Related bug (look at it before (re)designing the API): http://bugs.python.org/issue12806 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13023 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13023] argparse should allow displaying argument default values in addition to setting a formatter class
Changes by Terry J. Reedy tjre...@udel.edu: -- nosy: +bethard stage: - test needed versions: -Python 2.7, Python 3.2, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13023 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13023] argparse should allow displaying argument default values in addition to setting a formatter class
Zbyszek Szmek zbys...@in.waw.pl added the comment: Yeah, adding a formatter instance seems overkill for the usual case of wanting to preserver formatting of the epilog. -- nosy: +zbysz ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13023 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13023] argparse should allow displaying argument default values in addition to setting a formatter class
New submission from Denilson Figueiredo de Sá denilso...@gmail.com: In my script, I wanted two things at the same time: 1. Setting a formatter class so that the epilog would have the line breaks preserved. 2. Telling argparse to automatically display default values for all arguments. Currently, both things are handled by the same configuration parameter: formatter_class This means we can either pass argparse.RawDescriptionHelpFormatter or argparse.ArgumentDefaultsHelpFormatter, but not both. I did a hackish workaround by subclassing both formatters, and passing my (empty) subclass to ArgumentParser. It works for now, but it might break on future versions. The ideal solution, however, would have a native support for both features, or at least explicitly allowing subclassing. Maybe ArgumentDefaultsHelpFormatter could be transformed into a simple boolean parameter passed to ArgumentParser object (and maybe also passed to add_argument() method), instead of being a formatter class. -- components: Library (Lib) messages: 144354 nosy: denilsonsa priority: normal severity: normal status: open title: argparse should allow displaying argument default values in addition to setting a formatter class type: feature request versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13023 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com