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 an argument completely for compatibility, but you have logic which expects all the arguments returned by parse_args() to be known and meaningful. In any case, I wrote this ticket because I ran into a concrete need that argparse didn't readily support (which almost never happens!).
As for what the usage statement should show: it should behave as if dest=SUPPRESS were not present. If metavar is specified, use that, otherwise use the option name as if dest were not passed in. And we already have the behavior that help=SUPPRESS will hide it from the usage entirely, so that should still work (i.e. dest=SUPPRESS, help=SUPPRESS should hide the option both from --help and the result of parse_args()). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20430> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com