[issue26394] Have argparse provide ability to require a fallback value be present

Michael Herold report at bugs.python.org
Wed Mar 2 11:21:48 EST 2016


Michael Herold added the comment:

I have prepared a working patch to sketch how this could be implemented. A small example (example.py) shows how this feature can be used to implement a fallback to environment variables.

This patch allows Currying of positional arguments (i.e. you can give position 2 via fallback and provide position 1 via the command line). However, I think this might be too confusing and implicit.

Please let me know whether I should prepare a proper patch.

----------
keywords: +patch
Added file: http://bugs.python.org/file42061/argparse-wip-1.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26394>
_______________________________________


More information about the Python-bugs-list mailing list