Message193398
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. |
|
Date |
User |
Action |
Args |
2013-07-20 04:26:46 | paul.j3 | set | recipients:
+ paul.j3, matej.tyc |
2013-07-20 04:26:46 | paul.j3 | set | messageid: <1374294406.76.0.0861883216377.issue18467@psf.upfronthosting.co.za> |
2013-07-20 04:26:46 | paul.j3 | link | issue18467 messages |
2013-07-20 04:26:46 | paul.j3 | create | |
|