Irit Katriel added the comment:
Nesting argument groups and mutually exclusive groups is now deprecated (see
issue22047). Thank you for the bug report.
--
nosy: +iritkatriel
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Deprecate unsupported
paul j3 added the comment:
With one exception, groups are not designed or intended to be nested. But by
inheritance (from _ActionsContainer) nesting isn't blocked nor does it raise
any errors.
As you surmise, an ArgumentGroup, is used only for grouping the help lines. By
default that are
New submission from Tim Sanders :
argparse allows adding argument_groups inside of mutually_exclusive_groups, but
the behavior is unintuitive and a bit buggy.
Demo:
import argparse
parser = argparse.ArgumentParser()
single_group = parser.add_argument_group(title='single_group')