This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.j3
Recipients Tim Sanders, paul.j3
Date 2019-11-05.06:19:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572934780.6.0.735306954679.issue38590@roundup.psfhosted.org>
In-reply-to
Content
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 two groups, with 'optionals' and 'required' names (actually the later should be 'positional').  The rest are user defined.  They don't affect parsing in any way.

MutuallyExclusiveGroup is used in parsing.  It also is used, to the extent possible, when formatting usage.

If a MutuallyExclusiveGroup is nested inside another MutuallyExclusiveGroup the parsing effect is just one flat group.  Usage can be messed up - that's been the subject of another bug/issue.

A MutuallyExclusiveGroup may be put in an ArgumentGroup.  This is a way of giving the exclusive group a title and/or description in the help.

There is a bug/issue requesting some sort of inclusive group.  I tried to develop such a patch, implementing nesting, complete logic control (not just the current xor).  But the usage formatting needs a complete rewrite.  Overall this is too complex of an addition.  On StackOverFlow I tell people to implement their own post-parsing testing.
History
Date User Action Args
2019-11-05 06:19:40paul.j3setrecipients: + paul.j3, Tim Sanders
2019-11-05 06:19:40paul.j3setmessageid: <1572934780.6.0.735306954679.issue38590@roundup.psfhosted.org>
2019-11-05 06:19:40paul.j3linkissue38590 messages
2019-11-05 06:19:40paul.j3create