From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 22 Dec 2020 18:19:24 +0000 (-0800) Subject: bpo-29030: Document interaction between *choices* and *metavar*. (GH-23884) (GH-23894) X-Git-Tag: v3.9.2rc1~109 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ec2149708c7c06ebeccc27e28e2bbc51c4abeca;p=thirdparty%2FPython%2Fcpython.git bpo-29030: Document interaction between *choices* and *metavar*. (GH-23884) (GH-23894) --- diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 1a298cdd2b53..4542961d7816 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1152,6 +1152,11 @@ Any container can be passed as the *choices* value, so :class:`list` objects, Use of :class:`enum.Enum` is not recommended because it is difficult to control its appearance in usage, help, and error messages. +Formatted choices overrides the default *metavar* which is normally derived +from *dest*. This is usually what you want because the user never sees the +*dest* parameter. If this display isn't desirable (perhaps because there are +many choices), just specify an explicit metavar_. + required ^^^^^^^^