Message274337
This call used to be
namespace, arg_strings = parser.parse_known_args(arg_strings, namespace)
But in 2014 (2.7.9) http://bugs.python.org/issue9351 was implemented
As noted in the title and comment in the code, the idea was to give more power to the defaults set in the subparser.
But as noted in the subsequent posts, the patch has raised some backward compatibility issues.
Generally having the action for one argument depend on the value of another argument is tricky, because arguments may be parsed in any order. (but there is a 'test_argparse.py' case that does that kind of testing). It is safer to test for any interactions after parsing is all done.
Now in the subparser case, there is an order. Main parser arguments have to come first.
I suggested in 9351 a way of allowing both behaviors - use of new namespace or use of the existing one. But as you can see there hasn't been any further action in the past 2 years. |
|
Date |
User |
Action |
Args |
2016-09-04 04:54:41 | paul.j3 | set | recipients:
+ paul.j3, ericvw, nickpapior |
2016-09-04 04:54:41 | paul.j3 | set | messageid: <1472964881.32.0.196117229885.issue27859@psf.upfronthosting.co.za> |
2016-09-04 04:54:41 | paul.j3 | link | issue27859 messages |
2016-09-04 04:54:40 | paul.j3 | create | |
|