[issue20430] Make argparse.SUPPRESS work as an argument "dest"

2016-04-24 Thread paul j3
paul j3 added the comment: I just found a case where `dest` is `SUPPRESS` - the default subparsers setup. _SubParsersAction(option_strings=[], dest='==SUPPRESS==', nargs='A...', ... If I make this Action 'required' (in the current distribution 'subparsers' are not required - there's a b

[issue20430] Make argparse.SUPPRESS work as an argument "dest"

2014-05-28 Thread paul j3
paul j3 added the comment: In the attached file I tried another approach - a custom Action class. It gives you the custom behavior now, instead of 2-3 releases in the future. class Action2(Action): # custom action def __init__(self, *args, **kwargs): super(Actio

[issue20430] Make argparse.SUPPRESS work as an argument "dest"

2014-05-28 Thread jzwinck
jzwinck added the comment: Yes, I have a practical need for dest=SUPPRESS. One of the reasons is basically what you said: to implement things analogous to --help. In those cases you want to be able to invoke a function (e.g. via type=myfunc) but not store anything. Or you may need to ignore

[issue20430] Make argparse.SUPPRESS work as an argument "dest"

2014-05-27 Thread paul j3
paul j3 added the comment: If we make this change to '_StoreAction', we need to do it to 4 other subclasses which take the same 'setattr(namespace, self.dest, values)'. An alternative would be to define a 'Namespace' function that does this conditional 'setattr'. How should this 'SUPPRESS' af

[issue20430] Make argparse.SUPPRESS work as an argument "dest"

2014-01-28 Thread jzwinck
Changes by jzwinck : -- title: argparse.SUPPRESS -> Make argparse.SUPPRESS work as an argument "dest" ___ Python tracker ___ ___ Pytho