Michael Herold added the comment: Yes, a fallback hook at the end of parsing would have to be placed > before the 'required' testing, not after as in my 'group' testing.
Just to clarify: Would you suggest that a fallback call returns the parsed value (i.e. the fallback calls the action or alike) or `take_action` is called on fallback values after all the other calls are done? I will try to look into your hook system in detail. Maybe you are right and the ideas can be combined nicely. > I still haven't absorbed why this patch is superior to the > ConfigArgParse approach, or chaining dictionary values after parsing. Problems with ConfigArgParse I found: It ignores config and env vars completely if "--" is used on the command line. Implementing positional arguments supplied via config or env var is impossible. Chaining dictionary would require that all arguments are optional. I think that the "make everything optional" approach bypasses to many features of argparse. > I'd also suggest following its example in published this enhancement > in your own repository and pypi. Thanks for the suggestion. I will surely consider this. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26394> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com