diff -r 44f455e6163d Lib/argparse.py --- a/Lib/argparse.py Thu Jun 27 12:23:29 2013 +0200 +++ b/Lib/argparse.py Fri Jul 25 14:25:59 2014 -0700 @@ -1544,6 +1544,10 @@ super(_ArgumentGroup, self)._remove_action(action) self._group_actions.remove(action) + def add_argument_group(self, *args, **kwargs): + raise ValueError('Cannot nest groups') + # or NotImplementedError + class _MutuallyExclusiveGroup(_ArgumentGroup): @@ -1564,6 +1568,10 @@ self._container._remove_action(action) self._group_actions.remove(action) + def add_mutually_exclusive_group(self, **kwargs): + raise ValueError('Cannot nest mutually exclusive groups') + # or NotImplementedError + class ArgumentParser(_AttributeHolder, _ActionsContainer): """Object for parsing command line strings into Python objects.