diff -r 5c091acc799f Lib/argparse.py --- a/Lib/argparse.py Sat Aug 17 17:25:27 2013 +0200 +++ b/Lib/argparse.py Sat Aug 17 19:14:33 2013 +0300 @@ -1096,6 +1096,21 @@ return parser + def remove_parser(self, name, **kwargs): + # remove choice help from list + if 'help' in kwargs: + self._choices_actions = [action + for action in self._choices_actions + if action.metavar != name] + + # remove the parser from the map + self._name_parser_map.pop(name, None) + + # remove aliases + aliases = kwargs.pop('aliases', ()) + for alias in aliases: + self._name_parser_map.pop(alias, None) + def _get_subactions(self): return self._choices_actions