Message405007
parser = argparse.ArgumentParser()
sub = parser.add_subparsers()
example_subparser = sub.add_parser("example")
example_subparser.add_argument("--flag", default=10)
print(parser.parse_args(["example","--flag=15"], argparse.Namespace(flag=20)))
still returns flag=20
User input should override values set by the provided Namespace. |
|
Date |
User |
Action |
Args |
2021-10-25 23:27:59 | paul.j3 | set | recipients:
+ paul.j3, rhettinger, miss-islington, ALSchwalm |
2021-10-25 23:27:59 | paul.j3 | set | messageid: <1635204479.84.0.06343190333.issue45235@roundup.psfhosted.org> |
2021-10-25 23:27:59 | paul.j3 | link | issue45235 messages |
2021-10-25 23:27:59 | paul.j3 | create | |
|