[issue9625] argparse: Problem with defaults for variable nargs when using choices

2012-01-23 Thread Martin Pengelly-Phillips
Martin Pengelly-Phillips added the comment: The real issue is that the choices flag does not work with a default flag and * nargs. The following works as expected: >>> parser.add_argument('chosen', nargs='*', default=['a']) >>> print(parser

[issue9625] argparse: Problem with defaults for variable nargs

2010-08-17 Thread Martin Pengelly-Phillips
New submission from Martin Pengelly-Phillips : Variable argument count plays badly with choices. Example: >>> import argparse >>> parser = argparse.ArgumentParser() >>> parser.add_argument('choices', nargs='*', default='a