[issue28742] argparse.ArgumentDefaultsHelpFormatter sometimes provides inaccurate documentation of defaults, so they should be overrideable

2016-11-30 Thread Peter Eckersley
Peter Eckersley added the comment: Thanks for your feedback Paul! I agree your proposed implementation strategy would probably be saner; I'll revise the patch to use that approach or something like it. As for the question of necessity, there are definitely more cases than jus

[issue28742] argparse.ArgumentDefaultsHelpFormatter sometimes provides inaccurate documentation of defaults, so they should be overrideable

2016-12-06 Thread Peter Eckersley
Peter Eckersley added the comment: OK, here's another solution following paul.j3's suggestion. I think this is much better: https://gist.github.com/pde/817a00378d3f6ed73747dfffce323ae5 Tests & documentation included. -- ___ Python

[issue28742] argparse.ArgumentDefaultsHelpFormatter sometimes provides inaccurate documentation of defaults, so they should be overrideable

2016-11-18 Thread Peter Eckersley
New submission from Peter Eckersley: When argparse lists the default values for cli flags and arguments, it shows argparse's view of the internal Pythonic default, not the default behaviour of the program as a whole. This can be wrong in many cases, as documented at https://bugs.pytho

[issue28742] argparse.ArgumentDefaultsHelpFormatter sometimes provides inaccurate documentation of defaults, so they should be overrideable

2016-11-18 Thread Peter Eckersley
Peter Eckersley added the comment: One thing I noticed when testing my patch by vendorizing it into the Certbot tree was that if a developer had somehow inherited from a version of argparse.Action that *doesn't* have this patch applied to it, and then passes in instances of those inher

[issue28742] argparse.ArgumentDefaultsHelpFormatter sometimes provides inaccurate documentation of defaults, so they should be overrideable

2016-11-18 Thread Peter Eckersley
Peter Eckersley added the comment: Patch is now against the latest Python development tree, and includes test cases: https://gist.github.com/pde/daec08cadc21bca0d62852020887ee13 -- ___ Python tracker <http://bugs.python.org/issue28