paul j3 added the comment: Since parse_args takes an optional Namespace argument, you can set the its initial value to almost anything. For example, with the functions defined previously:
parser = argparse.ArgumentParser() parser.add_argument('-a','--algorithm', choices=['Q','S'], action=FooAction, type=bar) NS = parser.parse_args(['-a','S']) args = parser.parse_args(None, NS) The first parse_args uses FooAction to create a default Namespace, which is then passed to the second. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18467> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com