[issue41684] argparse: unexpected subparser behaviour on parse_args with namespace option

2020-09-20 Thread paul j3
Change by paul j3 : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue41684] argparse: unexpected subparser behaviour on parse_args with namespace option

2020-09-01 Thread Lucca Ruhland
Lucca Ruhland added the comment: Thank you very much for your support. I would say we can close this bug report. -- resolution: -> duplicate ___ Python tracker ___

[issue41684] argparse: unexpected subparser behaviour on parse_args with namespace option

2020-09-01 Thread paul j3
paul j3 added the comment: When there are potential conflicts between arguments set by the main parser and those set by a subparser, I often recommend giving the sub ones different "dest" parameters. Then you can reconcile the different values after parsing. There's nothing wrong with a

[issue41684] argparse: unexpected subparser behaviour on parse_args with namespace option

2020-09-01 Thread Lucca Ruhland
Lucca Ruhland added the comment: Sorry for the duplication, i haven't noticed the other bug reports. As far as i have seen, i would need to overwrite parts of the _SubParsersAction, _ActionsContainer and ArgumentParser class. Is there maybe an easier way to change the behavior? --

[issue41684] argparse: unexpected subparser behaviour on parse_args with namespace option

2020-09-01 Thread paul j3
paul j3 added the comment: I've noted this behavior before. https://bugs.python.org/issue27859 argparse - subparsers does not retain namespace https://bugs.python.org/issue9351 argparse set_defaults on subcommands should override top level set_defaults Due to a change 2012, the subparser

[issue41684] argparse: unexpected subparser behaviour on parse_args with namespace option

2020-09-01 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +paul.j3, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue41684] argparse: unexpected subparser behaviour on parse_args with namespace option

2020-09-01 Thread Lucca Ruhland
New submission from Lucca Ruhland : When parsing arguments with a namespace object, the subparser are behaving different than the main parser, although this is not stated in the documentation. Each attribute which is not already part of the namespace, should be saved into the namespace